Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Handle duplicate function signatures #543

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions tests/fixtures/functions/function_Dups.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
DROP FUNCTION IF EXISTS "MixedCase".function_dup(int, int, int);
CREATE OR REPLACE FUNCTION "MixedCase".function_dup("Z" int, x int, y int)
RETURNS TABLE("mVt" bytea, key text) AS $$
SELECT mvt, md5(mvt) as key FROM (
SELECT ST_AsMVT(tile, '"MixedCase".function_Dup', 4096, 'geom') as mvt FROM (
SELECT
ST_AsMVTGeom(
ST_Transform(ST_CurveToLine("Geom"), 3857),
ST_TileEnvelope("Z", x, y),
4096, 64, true) AS geom
FROM "MixedCase"."MixPoints"
WHERE "Geom" && ST_Transform(ST_TileEnvelope("Z", x, y), 4326)
) as tile WHERE geom IS NOT NULL) src
$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE;

DROP FUNCTION IF EXISTS "MixedCase"."function_Dup"(int, int, int);
CREATE OR REPLACE FUNCTION "MixedCase"."function_Dup"("Z" int, x int, y int)
RETURNS TABLE("mVt" bytea, key text) AS $$
SELECT mvt, md5(mvt) as key FROM (
SELECT ST_AsMVT(tile, '"MixedCase".function_Dup', 4096, 'geom') as mvt FROM (
SELECT
ST_AsMVTGeom(
ST_Transform(ST_CurveToLine("Geom"), 3857),
ST_TileEnvelope("Z", x, y),
4096, 64, true) AS geom
FROM "MixedCase"."MixPoints"
WHERE "Geom" && ST_Transform(ST_TileEnvelope("Z", x, y), 4326)
) as tile WHERE geom IS NOT NULL) src
$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE;

DROP FUNCTION IF EXISTS "MixedCase".function_dup(int, int, int, json);
CREATE OR REPLACE FUNCTION "MixedCase".function_dup(z int, x int, y int, query json)
RETURNS TABLE("mVt" bytea, key text) AS $$
SELECT mvt, md5(mvt) as key FROM (
SELECT ST_AsMVT(tile, '"MixedCase".function_Dup', 4096, 'geom') as mvt FROM (
SELECT
ST_AsMVTGeom(
ST_Transform(ST_CurveToLine("Geom"), 3857),
ST_TileEnvelope(z, x, y),
4096, 64, true) AS geom
FROM "MixedCase"."MixPoints"
WHERE "Geom" && ST_Transform(ST_TileEnvelope(z, x, y), 4326)
) as tile WHERE geom IS NOT NULL) src
$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE;

DROP FUNCTION IF EXISTS "MixedCase".function_dup(int, int, int, jsonb);
CREATE OR REPLACE FUNCTION "MixedCase".function_dup(z int, x int, y int, query jsonb)
RETURNS TABLE("mVt" bytea, key text) AS $$
SELECT mvt, md5(mvt) as key FROM (
SELECT ST_AsMVT(tile, '"MixedCase".function_Dup', 4096, 'geom') as mvt FROM (
SELECT
ST_AsMVTGeom(
ST_Transform(ST_CurveToLine("Geom"), 3857),
ST_TileEnvelope(z, x, y),
4096, 64, true) AS geom
FROM "MixedCase"."MixPoints"
WHERE "Geom" && ST_Transform(ST_TileEnvelope(z, x, y), 4326)
) as tile WHERE geom IS NOT NULL) src
$$ LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE;