diff options
author | aneporada <aneporada@yandex-team.com> | 2024-11-12 20:02:10 +0300 |
---|---|---|
committer | Maxim Yurchuk <maxim-yurchuk@ydb.tech> | 2024-11-12 22:40:29 +0300 |
commit | 06791fb116406f98a10593436968aabe51d1a856 (patch) | |
tree | 3a4c8f662423b3602767da02508ce5df0f54a2f2 /yql/essentials/parser | |
parent | 4e4600bae44c02ba4a94c8f7a397a2c63c3cc235 (diff) | |
download | ydb-06791fb116406f98a10593436968aabe51d1a856.tar.gz |
Merge PR #10831, #11068, #11075, #11152
#11152 - Allow to choose normal or aggreation PG function
#11075 - Handle invalid base
#11068 - Allow more postgis functions
#10831 - Views: if exists / if not exists for DDL
commit_hash:0ebf35e45ac6de147c9000440ca25237db061d2e
Diffstat (limited to 'yql/essentials/parser')
-rw-r--r-- | yql/essentials/parser/pg_catalog/catalog.cpp | 18 | ||||
-rw-r--r-- | yql/essentials/parser/pg_catalog/catalog.h | 1 | ||||
-rw-r--r-- | yql/essentials/parser/pg_catalog/safe_procs.h | 3 |
3 files changed, 22 insertions, 0 deletions
diff --git a/yql/essentials/parser/pg_catalog/catalog.cpp b/yql/essentials/parser/pg_catalog/catalog.cpp index 72ce7ade8c..05e6a48875 100644 --- a/yql/essentials/parser/pg_catalog/catalog.cpp +++ b/yql/essentials/parser/pg_catalog/catalog.cpp @@ -2362,6 +2362,24 @@ void EnumProc(std::function<void(ui32, const TProcDesc&)> f) { } } +bool HasProc(const TString& name, EProcKind kind) { + const auto& catalog = TCatalog::Instance(); + auto procIdPtr = catalog.State->ProcByName.FindPtr(to_lower(name)); + if (!procIdPtr) { + return false; + } + + for (const auto& id : *procIdPtr) { + const auto& d = catalog.State->Procs.FindPtr(id); + Y_ENSURE(d); + if (d->Kind == kind) { + return true; + } + } + + return false; +} + bool HasReturnSetProc(const TString& name) { const auto& catalog = TCatalog::Instance(); auto procIdPtr = catalog.State->ProcByName.FindPtr(to_lower(name)); diff --git a/yql/essentials/parser/pg_catalog/catalog.h b/yql/essentials/parser/pg_catalog/catalog.h index 4dac35dd1c..e753f2ebc8 100644 --- a/yql/essentials/parser/pg_catalog/catalog.h +++ b/yql/essentials/parser/pg_catalog/catalog.h @@ -283,6 +283,7 @@ const TProcDesc& LookupProc(ui32 procId); std::variant<const TProcDesc*, const TTypeDesc*> LookupProcWithCasts(const TString& name, const TVector<ui32>& argTypeIds); bool HasReturnSetProc(const TString& name); void EnumProc(std::function<void(ui32, const TProcDesc&)> f); +bool HasProc(const TString& name, EProcKind kind); bool HasType(const TString& name); bool HasType(ui32 typeId); diff --git a/yql/essentials/parser/pg_catalog/safe_procs.h b/yql/essentials/parser/pg_catalog/safe_procs.h index be13dd59c0..475711e601 100644 --- a/yql/essentials/parser/pg_catalog/safe_procs.h +++ b/yql/essentials/parser/pg_catalog/safe_procs.h @@ -39,6 +39,9 @@ // postgis "postgis_lib_version", +"st_interiorringn", +"st_collectionhomogenize", +"st_makeline", //dbeaver "pg_get_expr", |