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

export: remove precision conversion from tile calculation #1396

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class DatabaseMaintainer {
private static final Logger logger = LogManager.getLogger();

/** Is used to check against xyz_ext_version() */
public static final int XYZ_EXT_VERSION = 203;
public static final int XYZ_EXT_VERSION = 204;

public static final int H3_CORE_VERSION = 108;

Expand Down
17 changes: 12 additions & 5 deletions xyz-psql-connector/src/main/resources/xyz_ext.sql
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
CREATE OR REPLACE FUNCTION xyz_ext_version()
RETURNS integer AS
$BODY$
select 203
select 204
$BODY$
LANGUAGE sql IMMUTABLE;

Expand Down Expand Up @@ -3934,6 +3934,13 @@ $_$;
------------------------------------------------
------------------------------------------------

CREATE OR REPLACE FUNCTION _strip_conversion( tileqry_with_geo text ) -- temp workaround to fix sideefect slowing down tilequery DS-758
RETURNS text AS
$$
select replace(tileqry_with_geo,'st_geomfromtext(st_astext(geo,8),4326) as geo','geo')
$$
LANGUAGE sql IMMUTABLE;


create or replace function exp_build_sql_inhabited_txt(htile boolean, iqk text, mlevel integer, sql_with_jsondata_geo text, sql_qk_tileqry_with_geo text, max_tiles integer, base64enc boolean, clipped boolean, includeEmpty boolean)
returns table(qk text, mlev integer, sql_with_jsdata_geo text, max_tls integer, bucket integer, nrbuckets integer, nrsubtiles integer, tiles_total integer, tile_list text[], s3sql text)
Expand Down Expand Up @@ -3963,7 +3970,7 @@ begin
indata as ( select exp_build_sql_inhabited_txt.iqk as iqk,
exp_build_sql_inhabited_txt.mlevel as mlevel,
exp_build_sql_inhabited_txt.sql_with_jsondata_geo as sql_export_data,
coalesce( exp_build_sql_inhabited_txt.sql_qk_tileqry_with_geo, exp_build_sql_inhabited_txt.sql_with_jsondata_geo) as sql_qks,
_strip_conversion(coalesce( exp_build_sql_inhabited_txt.sql_qk_tileqry_with_geo, exp_build_sql_inhabited_txt.sql_with_jsondata_geo)) as sql_qks,
exp_build_sql_inhabited_txt.max_tiles as max_tiles
),
ibuckets as
Expand All @@ -3981,7 +3988,7 @@ begin
indata as ( select exp_build_sql_inhabited_txt.iqk as iqk,
exp_build_sql_inhabited_txt.mlevel as mlevel,
exp_build_sql_inhabited_txt.sql_with_jsondata_geo as sql_export_data,
coalesce( exp_build_sql_inhabited_txt.sql_qk_tileqry_with_geo, exp_build_sql_inhabited_txt.sql_with_jsondata_geo) as sql_qks,
_strip_conversion(coalesce( exp_build_sql_inhabited_txt.sql_qk_tileqry_with_geo, exp_build_sql_inhabited_txt.sql_with_jsondata_geo)) as sql_qks,
exp_build_sql_inhabited_txt.max_tiles as max_tiles
),
ibuckets as
Expand Down Expand Up @@ -4025,7 +4032,7 @@ begin
indata as ( select exp2_build_sql_inhabited_txt.iqk as iqk,
exp2_build_sql_inhabited_txt.mlevel as mlevel,
exp2_build_sql_inhabited_txt.sql_with_jsondata_geo as sql_export_data,
coalesce( exp2_build_sql_inhabited_txt.sql_qk_tileqry_with_geo, exp2_build_sql_inhabited_txt.sql_with_jsondata_geo) as sql_qks,
_strip_conversion(coalesce( exp2_build_sql_inhabited_txt.sql_qk_tileqry_with_geo, exp2_build_sql_inhabited_txt.sql_with_jsondata_geo)) as sql_qks,
exp2_build_sql_inhabited_txt.max_tiles as max_tiles
),
ibuckets as
Expand All @@ -4043,7 +4050,7 @@ begin
indata as ( select exp2_build_sql_inhabited_txt.iqk as iqk,
exp2_build_sql_inhabited_txt.mlevel as mlevel,
exp2_build_sql_inhabited_txt.sql_with_jsondata_geo as sql_export_data,
coalesce( exp2_build_sql_inhabited_txt.sql_qk_tileqry_with_geo, exp2_build_sql_inhabited_txt.sql_with_jsondata_geo) as sql_qks,
_strip_conversion(coalesce( exp2_build_sql_inhabited_txt.sql_qk_tileqry_with_geo, exp2_build_sql_inhabited_txt.sql_with_jsondata_geo)) as sql_qks,
exp2_build_sql_inhabited_txt.max_tiles as max_tiles
),
ibuckets as
Expand Down
Loading