aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpavelvelikhov <pavelvelikhov@yandex-team.com>2023-07-31 11:22:00 +0300
committerpavelvelikhov <pavelvelikhov@yandex-team.com>2023-07-31 11:22:00 +0300
commit8f3aab1e29cfbbe4943cda9a42c5a9e835bc3aa3 (patch)
treed332d4876e83f2aaa131228dd75d7c3022936fa6
parent9c6116dfba56d501a8c672a6771cc6b6744d2599 (diff)
downloadydb-8f3aab1e29cfbbe4943cda9a42c5a9e835bc3aa3.tar.gz
Added cannonical test for TopSort pushdown
Added a cannonical test for the issue
-rw-r--r--ydb/tests/functional/canonical/canondata/result.json10
-rw-r--r--ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases_2.sql-plan_/index_topsort_index_with_selector_aliases_2.sql.plan29
-rw-r--r--ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases_2.sql-result_sets_/index_topsort_index_with_selector_aliases_2.sql.results3
-rw-r--r--ydb/tests/functional/canonical/sql/index/create_table_with_index.scheme11
-rw-r--r--ydb/tests/functional/canonical/sql/index/topsort_index_with_selector_aliases_2.sql10
5 files changed, 63 insertions, 0 deletions
diff --git a/ydb/tests/functional/canonical/canondata/result.json b/ydb/tests/functional/canonical/canondata/result.json
index 0c5bcc4273f..5e34e39db7e 100644
--- a/ydb/tests/functional/canonical/canondata/result.json
+++ b/ydb/tests/functional/canonical/canondata/result.json
@@ -136,6 +136,16 @@
"uri": "file://test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases.sql-result_sets_/index_topsort_index_with_selector_aliases.sql.results"
}
},
+ "test_sql.TestCanonicalFolder1.test_case[index/topsort_index_with_selector_aliases_2.sql-plan]": {
+ "plan": {
+ "uri": "file://test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases_2.sql-plan_/index_topsort_index_with_selector_aliases_2.sql.plan"
+ }
+ },
+ "test_sql.TestCanonicalFolder1.test_case[index/topsort_index_with_selector_aliases_2.sql-result_sets]": {
+ "result_sets": {
+ "uri": "file://test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases_2.sql-result_sets_/index_topsort_index_with_selector_aliases_2.sql.results"
+ }
+ },
"test_sql.TestCanonicalFolder1.test_case[index_predicate_point.sql-plan]": {
"plan": {
"uri": "file://test_sql.TestCanonicalFolder1.test_case_index_predicate_point.sql-plan_/index_predicate_point.sql.plan"
diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases_2.sql-plan_/index_topsort_index_with_selector_aliases_2.sql.plan b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases_2.sql-plan_/index_topsort_index_with_selector_aliases_2.sql.plan
new file mode 100644
index 00000000000..2836e95c6b7
--- /dev/null
+++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases_2.sql-plan_/index_topsort_index_with_selector_aliases_2.sql.plan
@@ -0,0 +1,29 @@
+{
+ "meta": {
+ "type": "query",
+ "version": "0.2"
+ },
+ "tables": [
+ {
+ "name": "/local/base_index_topsort_index_with_selector_aliases_2_sql_plan/personal_storefront",
+ "reads": [
+ {
+ "columns": [
+ "hashOrderDate",
+ "orderDate",
+ "orderId"
+ ],
+ "limit": "1000",
+ "lookup_by": [
+ "hashOrderDate (9983033094796217818)",
+ "orderDate (\u00ab2023-03-01\u00bb)"
+ ],
+ "scan_by": [
+ "orderId (-\u221e, +\u221e)"
+ ],
+ "type": "Lookup"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases_2.sql-result_sets_/index_topsort_index_with_selector_aliases_2.sql.results b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases_2.sql-result_sets_/index_topsort_index_with_selector_aliases_2.sql.results
new file mode 100644
index 00000000000..5825bcacc69
--- /dev/null
+++ b/ydb/tests/functional/canonical/canondata/test_sql.TestCanonicalFolder1.test_case_index_topsort_index_with_selector_aliases_2.sql-result_sets_/index_topsort_index_with_selector_aliases_2.sql.results
@@ -0,0 +1,3 @@
+[
+ []
+] \ No newline at end of file
diff --git a/ydb/tests/functional/canonical/sql/index/create_table_with_index.scheme b/ydb/tests/functional/canonical/sql/index/create_table_with_index.scheme
index 9a5c2d3f306..604f21c8c25 100644
--- a/ydb/tests/functional/canonical/sql/index/create_table_with_index.scheme
+++ b/ydb/tests/functional/canonical/sql/index/create_table_with_index.scheme
@@ -9,3 +9,14 @@ CREATE TABLE NewTableWithIndex (
INDEX NewIndex1 GLOBAL ON (Index1A, Index1B),
INDEX NewIndex2 GLOBAL ON (Index2)
);
+
+CREATE TABLE personal_storefront
+(
+ hashOrderDate Uint64,
+ orderDate String,
+ orderId Uint64,
+ buyerFullNamePdId String,
+ recipientFullNamePdId String,
+ courierAddressPdId String,
+ PRIMARY KEY (hashOrderDate, orderDate, orderId)
+);
diff --git a/ydb/tests/functional/canonical/sql/index/topsort_index_with_selector_aliases_2.sql b/ydb/tests/functional/canonical/sql/index/topsort_index_with_selector_aliases_2.sql
new file mode 100644
index 00000000000..a6d01e339f0
--- /dev/null
+++ b/ydb/tests/functional/canonical/sql/index/topsort_index_with_selector_aliases_2.sql
@@ -0,0 +1,10 @@
+--!syntax_v1
+select
+ hashOrderDate,
+ orderDate,
+ orderId as f1
+from personal_storefront
+where hashOrderDate = Digest::MurMurHash('2023-03-01')
+ and orderDate = '2023-03-01'
+order by hashOrderDate asc, orderDate asc, f1 asc
+limit 1000;