Skip to content

Commit

Permalink
postgis functions from regress tests (#7225)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitstn authored Jul 31, 2024
1 parent 2e45929 commit e464b73
Show file tree
Hide file tree
Showing 10 changed files with 333 additions and 30 deletions.
1 change: 1 addition & 0 deletions ydb/library/yql/parser/pg_catalog/catalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,7 @@ const TColumnInfoRaw AllStaticColumnsRaw[] = {
const char* AllowedProcsRaw[] = {
#include "safe_procs.h"
#include "used_procs.h"
#include "postgis_procs.h"
};

struct TCatalog : public IExtensionDDLBuilder {
Expand Down
241 changes: 241 additions & 0 deletions ydb/library/yql/parser/pg_catalog/postgis_procs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
"box2d",
"box2df_in",
"box2df_out",
"box2d_in",
"box2d_out",
"box3d",
"box3d_in",
"box3d_out",
"brin_summarize_new_values",
"geography",
"geography_in",
"geography_out",
"geography_recv",
"geography_send",
"geography_typmod_in",
"geography_typmod_out",
"geometry",
"geometry_in",
"geometry_out",
"geometry_recv",
"geometry_send",
"geometrytype",
"geometry_typmod_in",
"geometry_typmod_out",
"gidx_in",
"gidx_out",
"postgis_addbbox",
"postgis_dropbbox",
"_postgis_index_extent",
"_postgis_join_selectivity",
"_postgis_selectivity",
"_postgis_stats",
"spheroid_in",
"spheroid_out",
"st_3dclosestpoint",
"st_3ddfullywithin",
"st_3ddistance",
"st_3ddwithin",
"st_3dintersects",
"st_3dlength",
"st_3dlineinterpolatepoint",
"st_3dlongestline",
"st_3dmakebox",
"st_3dmaxdistance",
"st_3dperimeter",
"st_3dshortestline",
"st_addmeasure",
"st_addpoint",
"st_angle",
"st_area",
"st_area2d",
"st_asbinary",
"st_asencodedpolyline",
"st_asewkb",
"st_asewkt",
"st_asgeojson",
"st_asgml",
"st_askml",
"st_aslatlontext",
"st_asmarc21",
"st_asmvtgeom",
"st_assvg",
"st_astext",
"st_astwkb",
"st_azimuth",
"st_boundary",
"st_box2dfromgeohash",
"st_buffer",
"st_buildarea",
"st_centroid",
"st_chaikinsmoothing",
"st_closestpoint",
"st_closestpointofapproach",
"st_collect",
"st_collectionextract",
"st_contains",
"st_containsproperly",
"st_convexhull",
"st_coveredby",
"st_covers",
"st_cpawithin",
"st_crosses",
"st_curvetoline",
"st_delaunaytriangles",
"st_dfullywithin",
"st_difference",
"st_dimension",
"st_disjoint",
"st_distance",
"st_distancecpa",
"st_distancespheroid",
"st_dump",
"st_dumppoints",
"st_dumpsegments",
"st_dwithin",
"st_endpoint",
"st_envelope",
"st_equals",
"st_estimatedextent",
"st_expand",
"st_filterbym",
"st_flipcoordinates",
"st_force2d",
"st_force3dm",
"st_force3dz",
"st_force4d",
"st_forcecollection",
"st_forcecurve",
"st_forcepolygoncw",
"st_forcerhr",
"st_frechetdistance",
"st_generatepoints",
"st_geogfromtext",
"st_geographyfromtext",
"st_geohash",
"st_geometricmedian",
"st_geometryfromtext",
"st_geometryn",
"st_geometrytype",
"st_geomfromewkb",
"st_geomfromewkt",
"st_geomfromgeojson",
"st_geomfromgml",
"st_geomfromkml",
"st_geomfrommarc21",
"st_geomfromtext",
"st_geomfromtwkb",
"st_geomfromwkb",
"st_hasarc",
"st_hausdorffdistance",
"st_hexagon",
"st_hexagongrid",
"st_interpolatepoint",
"st_intersection",
"st_intersects",
"st_isclosed",
"st_iscollection",
"st_ispolygonccw",
"st_ispolygoncw",
"st_isring",
"st_issimple",
"st_isvalid",
"st_isvaliddetail",
"st_isvalidreason",
"st_isvalidtrajectory",
"st_largestemptycircle",
"st_length",
"st_length2d",
"st_length2dspheroid",
"st_lengthspheroid",
"st_linecrossingdirection",
"st_lineextend",
"st_linefromencodedpolyline",
"st_lineinterpolatepoint",
"st_lineinterpolatepoints",
"st_linelocatepoint",
"st_linemerge",
"st_linesubstring",
"st_linetocurve",
"st_locatealong",
"st_locatebetween",
"st_locatebetweenelevations",
"st_m",
"st_makebox2d",
"st_makeenvelope",
"st_makeline",
"st_makepoint",
"st_makepointm",
"st_makepolygon",
"st_makevalid",
"st_maximuminscribedcircle",
"st_memsize",
"st_minimumboundingcircle",
"st_minimumboundingradius",
"st_minimumclearance",
"st_minimumclearanceline",
"st_multi",
"st_ndims",
"st_normalize",
"st_npoints",
"st_nrings",
"st_numgeometries",
"st_numinteriorrings",
"st_numpoints",
"st_offsetcurve",
"st_orderingequals",
"st_orientedenvelope",
"st_overlaps",
"st_perimeter",
"st_perimeter2d",
"st_point",
"st_pointfromgeohash",
"st_pointm",
"st_pointn",
"st_pointonsurface",
"st_points",
"st_pointz",
"st_pointzm",
"st_polygonize",
"st_project",
"st_quantizecoordinates",
"st_reduceprecision",
"st_relate",
"st_relatematch",
"st_removepoint",
"st_removerepeatedpoints",
"st_reverse",
"st_scale",
"st_scroll",
"st_segmentize",
"st_setpoint",
"st_setsrid",
"st_sharedpaths",
"st_shiftlongitude",
"st_shortestline",
"st_simplify",
"st_simplifypolygonhull",
"st_simplifypreservetopology",
"st_simplifyvw",
"st_snap",
"st_snaptogrid",
"st_split",
"st_square",
"st_squaregrid",
"st_srid",
"st_startpoint",
"st_subdivide",
"st_summary",
"st_swapordinates",
"st_symdifference",
"st_tileenvelope",
"st_touches",
"st_transform",
"st_triangulatepolygon",
"st_unaryunion",
"st_union",
"st_within",
"st_wkbtosql",
"st_x",
"st_y",
"st_z",
1 change: 1 addition & 0 deletions ydb/library/yql/parser/pg_catalog/safe_procs.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"pg_total_relation_size",
"row_to_json",
"version",
"pow",

"set_config",//pgadmin
"pg_is_in_recovery",//pgadmin
Expand Down
1 change: 1 addition & 0 deletions ydb/library/yql/parser/pg_wrapper/comp_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4992,6 +4992,7 @@ void PgReleaseThreadContext(void* ctx) {
class TExtensionLoader : public NYql::NPg::IExtensionLoader {
public:
void Load(ui32 extensionIndex, const TString& name, const TString& path) final {
RebuildSysCache();
TExtensionsRegistry::Instance().Load(extensionIndex, name, path);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static char *read_whole_file(const char *filename, int *length);
* true, just return InvalidOid.
*/
Oid
get_extension_oid(const char *extname, bool missing_ok)
get_extension_oid_original(const char *extname, bool missing_ok)
{
Oid result;
Relation rel;
Expand Down Expand Up @@ -186,7 +186,7 @@ get_extension_oid(const char *extname, bool missing_ok)
* Returns a palloc'd string, or NULL if no such extension.
*/
char *
get_extension_name(Oid ext_oid)
get_extension_name_original(Oid ext_oid)
{
char *result;
Relation rel;
Expand Down Expand Up @@ -225,7 +225,7 @@ get_extension_name(Oid ext_oid)
* Returns InvalidOid if no such extension.
*/
Oid
get_extension_schema(Oid ext_oid)
get_extension_schema_original(Oid ext_oid)
{
Oid result;
Relation rel;
Expand Down
Loading

0 comments on commit e464b73

Please sign in to comment.