aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraneporada <aneporada@ydb.tech>2023-11-18 10:31:59 +0300
committeraneporada <aneporada@ydb.tech>2023-11-18 10:50:00 +0300
commit99bd8fc857676cbd472885b8f469a0d757791f6d (patch)
tree0f9514a0e0c2a2275d357cae8b74bb43daad07ec
parent4ab41f5f07dd3ea0071546538fdcce8922290766 (diff)
downloadydb-99bd8fc857676cbd472885b8f469a0d757791f6d.tar.gz
Unbreak passing IsStrict/SupportsBlocks udf flags in yqlworker
-rw-r--r--ydb/library/yql/core/yql_udf_index.cpp8
-rw-r--r--ydb/library/yql/core/yql_udf_index.h2
-rw-r--r--ydb/library/yql/providers/common/udf_resolve/yql_udf_resolver_with_index.cpp2
-rw-r--r--ydb/library/yql/tests/sql/dq_file/part5/canondata/result.json22
-rw-r--r--ydb/library/yql/tests/sql/sql2yql/canondata/result.json14
-rw-r--r--ydb/library/yql/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.cfg3
-rw-r--r--ydb/library/yql/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.sql6
-rw-r--r--ydb/library/yql/tests/sql/yt_native_file/part5/canondata/result.json21
8 files changed, 78 insertions, 0 deletions
diff --git a/ydb/library/yql/core/yql_udf_index.cpp b/ydb/library/yql/core/yql_udf_index.cpp
index a544aca6a8..fa4b2a668e 100644
--- a/ydb/library/yql/core/yql_udf_index.cpp
+++ b/ydb/library/yql/core/yql_udf_index.cpp
@@ -41,6 +41,14 @@ TVector<TResourceInfo::TPtr> ConvertResolveResultToResources(const TResolveResul
newFunction.RunConfigType = udf.GetRunConfigType();
}
+ if (udf.HasIsStrict()) {
+ newFunction.IsStrict = udf.GetIsStrict();
+ }
+
+ if (udf.HasSupportsBlocks()) {
+ newFunction.SupportsBlocks = udf.GetSupportsBlocks();
+ }
+
functionIndex[package].push_back(newFunction);
}
diff --git a/ydb/library/yql/core/yql_udf_index.h b/ydb/library/yql/core/yql_udf_index.h
index 51f768d9de..41896d191d 100644
--- a/ydb/library/yql/core/yql_udf_index.h
+++ b/ydb/library/yql/core/yql_udf_index.h
@@ -17,6 +17,8 @@ struct TFunctionInfo {
bool IsTypeAwareness = false;
TString CallableType;
TString RunConfigType;
+ bool IsStrict = false;
+ bool SupportsBlocks = false;
};
// todo: specify whether path is frozen
diff --git a/ydb/library/yql/providers/common/udf_resolve/yql_udf_resolver_with_index.cpp b/ydb/library/yql/providers/common/udf_resolve/yql_udf_resolver_with_index.cpp
index 9fd436fdc5..20bf53786d 100644
--- a/ydb/library/yql/providers/common/udf_resolve/yql_udf_resolver_with_index.cpp
+++ b/ydb/library/yql/providers/common/udf_resolve/yql_udf_resolver_with_index.cpp
@@ -187,6 +187,8 @@ private:
}
function.NormalizedUserType = std::get<0>(ctx.SingletonTypeCache);
+ function.IsStrict = info.IsStrict;
+ function.SupportsBlocks = info.SupportsBlocks;
return true;
}
diff --git a/ydb/library/yql/tests/sql/dq_file/part5/canondata/result.json b/ydb/library/yql/tests/sql/dq_file/part5/canondata/result.json
index 4851d57fba..04b3f51528 100644
--- a/ydb/library/yql/tests/sql/dq_file/part5/canondata/result.json
+++ b/ydb/library/yql/tests/sql/dq_file/part5/canondata/result.json
@@ -3043,6 +3043,28 @@
"uri": "https://{canondata_backend}/1599023/4e9b507a0cbcf5cfc31288de53bbb8560bb1a4bf/resource.tar.gz#test.test_join-pushdown_filter_over_inner_with_assume_strict-off-Results_/results.txt"
}
],
+ "test.test[join-pushdown_filter_over_inner_with_strict_udf--Analyze]": [
+ {
+ "checksum": "f17c90360c32b98bd39dae5196c13266",
+ "size": 7181,
+ "uri": "https://{canondata_backend}/1889210/cdea4d984d293e4c4894b43fbddd80f6768144c4/resource.tar.gz#test.test_join-pushdown_filter_over_inner_with_strict_udf--Analyze_/plan.txt"
+ }
+ ],
+ "test.test[join-pushdown_filter_over_inner_with_strict_udf--Debug]": [
+ {
+ "checksum": "05a2007d81d74ca83d3a9dbbafcad0d3",
+ "size": 2991,
+ "uri": "https://{canondata_backend}/1889210/cdea4d984d293e4c4894b43fbddd80f6768144c4/resource.tar.gz#test.test_join-pushdown_filter_over_inner_with_strict_udf--Debug_/opt.yql_patched"
+ }
+ ],
+ "test.test[join-pushdown_filter_over_inner_with_strict_udf--Plan]": [
+ {
+ "checksum": "f17c90360c32b98bd39dae5196c13266",
+ "size": 7181,
+ "uri": "https://{canondata_backend}/1889210/cdea4d984d293e4c4894b43fbddd80f6768144c4/resource.tar.gz#test.test_join-pushdown_filter_over_inner_with_strict_udf--Plan_/plan.txt"
+ }
+ ],
+ "test.test[join-pushdown_filter_over_inner_with_strict_udf--Results]": [],
"test.test[join-simple_columns_partial--Analyze]": [
{
"checksum": "c1b9041ade6003997ec6a7cbe7cc910e",
diff --git a/ydb/library/yql/tests/sql/sql2yql/canondata/result.json b/ydb/library/yql/tests/sql/sql2yql/canondata/result.json
index 1e3e2995a6..50898566af 100644
--- a/ydb/library/yql/tests/sql/sql2yql/canondata/result.json
+++ b/ydb/library/yql/tests/sql/sql2yql/canondata/result.json
@@ -8259,6 +8259,13 @@
"uri": "https://{canondata_backend}/1809005/3ee9082e72a32fad63796f61cc848db257f9b05e/resource.tar.gz#test_sql2yql.test_join-pushdown_filter_over_inner_with_assume_strict_/sql.yql"
}
],
+ "test_sql2yql.test[join-pushdown_filter_over_inner_with_strict_udf]": [
+ {
+ "checksum": "f46cd2f8af823e43fa0291c2aef67212",
+ "size": 1643,
+ "uri": "https://{canondata_backend}/1775059/87582fba3a918813eef87a5915ee3133a72473f1/resource.tar.gz#test_sql2yql.test_join-pushdown_filter_over_inner_with_strict_udf_/sql.yql"
+ }
+ ],
"test_sql2yql.test[join-pushdown_filter_over_left]": [
{
"checksum": "5cef6935277c1cf3116cbdd407ae26ad",
@@ -25304,6 +25311,13 @@
"uri": "https://{canondata_backend}/1599023/4bd7e6892a9762eec433e60bda88f20cddadc74c/resource.tar.gz#test_sql_format.test_join-pushdown_filter_over_inner_with_assume_strict_/formatted.sql"
}
],
+ "test_sql_format.test[join-pushdown_filter_over_inner_with_strict_udf]": [
+ {
+ "checksum": "07df0b8d006c7d40a15b7fb2460c095d",
+ "size": 225,
+ "uri": "https://{canondata_backend}/1775059/87582fba3a918813eef87a5915ee3133a72473f1/resource.tar.gz#test_sql_format.test_join-pushdown_filter_over_inner_with_strict_udf_/formatted.sql"
+ }
+ ],
"test_sql_format.test[join-pushdown_filter_over_left]": [
{
"checksum": "29337ac9d755c710fc774544713ab9ff",
diff --git a/ydb/library/yql/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.cfg b/ydb/library/yql/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.cfg
new file mode 100644
index 0000000000..75143a2d4b
--- /dev/null
+++ b/ydb/library/yql/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.cfg
@@ -0,0 +1,3 @@
+in Input1 input1.txt
+in Input2 input2.txt
+udf math_udf
diff --git a/ydb/library/yql/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.sql b/ydb/library/yql/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.sql
new file mode 100644
index 0000000000..12ab5e8f6d
--- /dev/null
+++ b/ydb/library/yql/tests/sql/suites/join/pushdown_filter_over_inner_with_strict_udf.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+PRAGMA DisableSimpleColumns;
+use plato;
+
+-- should pushdown
+select * from Input1 as a inner join Input2 as b on a.key = b.key where Math::IsFinite(cast(a.key as Double)) order by a.key;
diff --git a/ydb/library/yql/tests/sql/yt_native_file/part5/canondata/result.json b/ydb/library/yql/tests/sql/yt_native_file/part5/canondata/result.json
index 01af44aad6..77b891c607 100644
--- a/ydb/library/yql/tests/sql/yt_native_file/part5/canondata/result.json
+++ b/ydb/library/yql/tests/sql/yt_native_file/part5/canondata/result.json
@@ -2721,6 +2721,27 @@
"uri": "https://{canondata_backend}/1689644/9fe79f61eee315131553fff4e7b96fb8a8fb4bba/resource.tar.gz#test.test_join-premap_common_right_tablecontent--Results_/results.txt"
}
],
+ "test.test[join-pushdown_filter_over_inner_with_strict_udf--Debug]": [
+ {
+ "checksum": "6d1c9d9f43c3cd73485c876d83948109",
+ "size": 5451,
+ "uri": "https://{canondata_backend}/1889210/6d1d17f5eb1c27507d12542dacbb65befb33a533/resource.tar.gz#test.test_join-pushdown_filter_over_inner_with_strict_udf--Debug_/opt.yql"
+ }
+ ],
+ "test.test[join-pushdown_filter_over_inner_with_strict_udf--Plan]": [
+ {
+ "checksum": "2bddf585f6da3eda189254c6159b374f",
+ "size": 8840,
+ "uri": "https://{canondata_backend}/1889210/6d1d17f5eb1c27507d12542dacbb65befb33a533/resource.tar.gz#test.test_join-pushdown_filter_over_inner_with_strict_udf--Plan_/plan.txt"
+ }
+ ],
+ "test.test[join-pushdown_filter_over_inner_with_strict_udf--Results]": [
+ {
+ "checksum": "3ccf9b84ae5dd9088d7d6a5bed91d4e5",
+ "size": 2816,
+ "uri": "https://{canondata_backend}/1889210/6d1d17f5eb1c27507d12542dacbb65befb33a533/resource.tar.gz#test.test_join-pushdown_filter_over_inner_with_strict_udf--Results_/results.txt"
+ }
+ ],
"test.test[join-simple_columns_partial--Debug]": [
{
"checksum": "f96b3d855accc878be5fe883847d406d",