aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/TimeOrderRecover
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2024-11-20 11:14:58 +0000
committerAlexander Smirnov <alex@ydb.tech>2024-11-20 11:14:58 +0000
commit31773f157bf8164364649b5f470f52dece0a4317 (patch)
tree33d0f7eef45303ab68cf08ab381ce5e5e36c5240 /yql/essentials/tests/s-expressions/suites/TimeOrderRecover
parent2c7938962d8689e175574fc1e817c05049f27905 (diff)
parenteff600952d5dfe17942f38f510a8ac2b203bb3a5 (diff)
downloadydb-31773f157bf8164364649b5f470f52dece0a4317.tar.gz
Merge branch 'rightlib' into mergelibs-241120-1113
Diffstat (limited to 'yql/essentials/tests/s-expressions/suites/TimeOrderRecover')
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ahead.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/default.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/delayed.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path_tighter.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt20
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt.attr6
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt15
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt.attr6
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.cfg1
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.yql14
-rw-r--r--yql/essentials/tests/s-expressions/suites/TimeOrderRecover/row_limit.yql14
12 files changed, 133 insertions, 0 deletions
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ahead.yql b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ahead.yql
new file mode 100644
index 0000000000..b555f9f06c
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ahead.yql
@@ -0,0 +1,14 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())))
+(let inputFlow (ToFlow (PersistableRepr (OrderedSqlProject $2 '((SqlProjectStarItem (TypeOf $2) '"" (lambda '($4) $4) '()))))))
+(let timeOrderRecover (TimeOrderRecover
+ inputFlow
+ (lambda '($3) (Member $3 '"ts"))
+ (Interval '-10)
+ (Interval '5)
+ (Uint32 '12)
+))
+(let $3 (Write! world $1 (Key)(ForwardList timeOrderRecover)'('('type) '('autoref))))
+(return (CommitAll! (Commit! $3 $1)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/default.cfg b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/default.cfg
new file mode 100644
index 0000000000..58878f8945
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/default.cfg
@@ -0,0 +1 @@
+in Input input.txt
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/delayed.yql b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/delayed.yql
new file mode 100644
index 0000000000..e72c6ab87e
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/delayed.yql
@@ -0,0 +1,14 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())))
+(let inputFlow (ToFlow (PersistableRepr (OrderedSqlProject $2 '((SqlProjectStarItem (TypeOf $2) '"" (lambda '($4) $4) '()))))))
+(let timeOrderRecover (TimeOrderRecover
+ inputFlow
+ (lambda '($3) (Member $3 '"ts"))
+ (Interval '-8)
+ (Interval '10)
+ (Uint32 '12)
+))
+(let $3 (Write! world $1 (Key)(ForwardList timeOrderRecover)'('('type) '('autoref))))
+(return (CommitAll! (Commit! $3 $1)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path.yql b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path.yql
new file mode 100644
index 0000000000..6e247b28bd
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path.yql
@@ -0,0 +1,14 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())))
+(let inputFlow (ToFlow (PersistableRepr (OrderedSqlProject $2 '((SqlProjectStarItem (TypeOf $2) '"" (lambda '($4) $4) '()))))))
+(let timeOrderRecover (TimeOrderRecover
+ inputFlow
+ (lambda '($3) (Member $3 '"ts"))
+ (Interval '-10)
+ (Interval '10)
+ (Uint32 '20)
+))
+(let $3 (Write! world $1 (Key)(ForwardList timeOrderRecover)'('('type) '('autoref))))
+(return (CommitAll! (Commit! $3 $1)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path_tighter.yql b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path_tighter.yql
new file mode 100644
index 0000000000..3844a8e284
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/happy_path_tighter.yql
@@ -0,0 +1,14 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())))
+(let inputFlow (ToFlow (PersistableRepr (OrderedSqlProject $2 '((SqlProjectStarItem (TypeOf $2) '"" (lambda '($4) $4) '()))))))
+(let timeOrderRecover (TimeOrderRecover
+ inputFlow
+ (lambda '($3) (Member $3 '"ts"))
+ (Interval '-9)
+ (Interval '10)
+ (Uint32 '12)
+))
+(let $3 (Write! world $1 (Key)(ForwardList timeOrderRecover)'('('type) '('autoref))))
+(return (CommitAll! (Commit! $3 $1)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt
new file mode 100644
index 0000000000..995734fc7d
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt
@@ -0,0 +1,20 @@
+{"ts"=1000u; "col1"="a"};
+{"ts"=1009u; "col1"="aaa"};
+{"ts"=1001u; "col1"="a"};
+{"ts"=1003u; "col1"="aaa"};
+{"ts"=1002u; "col1"="aa"};
+{"ts"=1005u; "col1"="aa"};
+{"ts"=1004u; "col1"="a"};
+{"ts"=1006u; "col1"="aaa"};
+{"ts"=1015u; "col1"="aa"};
+{"ts"=1007u; "col1"="a"};
+{"ts"=1008u; "col1"="aa"};
+{"ts"=1010u; "col1"="aa"};
+{"ts"=1011u; "col1"="aaa"};
+{"ts"=1012u; "col1"="aa"};
+{"ts"=1013u; "col1"="aaa"};
+{"ts"=1014u; "col1"="a"};
+{"ts"=1016u; "col1"="aaa"};
+{"ts"=1017u; "col1"="aaa"};
+{"ts"=1018u; "col1"="a"};
+{"ts"=1019u; "col1"="aaa"};
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt.attr b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt.attr
new file mode 100644
index 0000000000..63d77d6812
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["ts";["DataType";"Timestamp"]];
+ ["col1";["DataType";"String"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt
new file mode 100644
index 0000000000..1363c953b6
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt
@@ -0,0 +1,15 @@
+{"ts"=1000u; "col1"="a1"};
+{"ts"=1000u; "col1"="a2"};
+{"ts"=1000u; "col1"="a3"};
+{"ts"=1000u; "col1"="a4"};
+{"ts"=1000u; "col1"="a5"};
+{"ts"=1001u; "col1"="b1"};
+{"ts"=1001u; "col1"="b2"};
+{"ts"=1001u; "col1"="b3"};
+{"ts"=1001u; "col1"="b4"};
+{"ts"=1001u; "col1"="b5"};
+{"ts"=1002u; "col1"="c1"};
+{"ts"=1002u; "col1"="c2"};
+{"ts"=1002u; "col1"="c3"};
+{"ts"=1002u; "col1"="c4"};
+{"ts"=1002u; "col1"="c5"}; \ No newline at end of file
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt.attr b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt.attr
new file mode 100644
index 0000000000..63d77d6812
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/input_ordering.txt.attr
@@ -0,0 +1,6 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["ts";["DataType";"Timestamp"]];
+ ["col1";["DataType";"String"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.cfg b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.cfg
new file mode 100644
index 0000000000..144fceddb1
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.cfg
@@ -0,0 +1 @@
+in Input input_ordering.txt
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.yql b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.yql
new file mode 100644
index 0000000000..840af03240
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/ordering.yql
@@ -0,0 +1,14 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())))
+(let inputFlow (ToFlow (PersistableRepr (OrderedSqlProject $2 '((SqlProjectStarItem (TypeOf $2) '"" (lambda '($4) $4) '()))))))
+(let timeOrderRecover (TimeOrderRecover
+ inputFlow
+ (lambda '($3) (Member $3 '"ts"))
+ (Interval '-10)
+ (Interval '10)
+ (Uint32 '100)
+))
+(let $3 (Write! world $1 (Key)(ForwardList timeOrderRecover)'('('type) '('autoref))))
+(return (CommitAll! (Commit! $3 $1)))
+)
diff --git a/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/row_limit.yql b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/row_limit.yql
new file mode 100644
index 0000000000..1eec5d6236
--- /dev/null
+++ b/yql/essentials/tests/s-expressions/suites/TimeOrderRecover/row_limit.yql
@@ -0,0 +1,14 @@
+(
+(let $1 (DataSink 'result))
+(let $2 (Right! (Read! world (DataSource '"yt" '"plato") (MrTableConcat (Key '('table (String '"Input")))) (Void) '())))
+(let inputFlow (ToFlow (PersistableRepr (OrderedSqlProject $2 '((SqlProjectStarItem (TypeOf $2) '"" (lambda '($4) $4) '()))))))
+(let timeOrderRecover (TimeOrderRecover
+ inputFlow
+ (lambda '($3) (Member $3 '"ts"))
+ (Interval '-10)
+ (Interval '10)
+ (Uint32 '3)
+))
+(let $3 (Write! world $1 (Key)(ForwardList timeOrderRecover)'('('type) '('autoref))))
+(return (CommitAll! (Commit! $3 $1)))
+)