Navigation Menu

Skip to content

Commit

Permalink
test: add columns[NAME].window.sort_keys test case without cache
Browse files Browse the repository at this point in the history
  • Loading branch information
kenhys committed Apr 14, 2017
1 parent eb8f465 commit c4bf8fb
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 0 deletions.
115 changes: 115 additions & 0 deletions test/command/suite/select/cache/columns/window_sort_keys.expected
@@ -0,0 +1,115 @@
table_create Items TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
column_create Items price COLUMN_SCALAR UInt32
[[0,0.0,0.0],true]
column_create Items comment COLUMN_SCALAR UInt32
[[0,0.0,0.0],true]
load --table Items
[
{"_key": "item1", "price": 200, "comment": 10},
{"_key": "item2", "price": 100, "comment": 30},
{"_key": "item3", "price": 300, "comment": 20}
]
[[0,0.0,0.0],3]
select Items --columns[nth_record].stage initial --columns[nth_record].value 'record_number()' --columns[nth_record].type UInt32 --columns[nth_record].window.sort_keys price --output_columns '_key, price, comment, nth_record'
[
[
0,
0.0,
0.0
],
[
[
[
3
],
[
[
"_key",
"ShortText"
],
[
"price",
"UInt32"
],
[
"comment",
"UInt32"
],
[
"nth_record",
"UInt32"
]
],
[
"item1",
200,
10,
2
],
[
"item2",
100,
30,
1
],
[
"item3",
300,
20,
3
]
]
]
]
select Items --columns[nth_record].stage initial --columns[nth_record].value 'record_number()' --columns[nth_record].type UInt32 --columns[nth_record].window.sort_keys comment --output_columns '_key, price, comment, nth_record'
[
[
0,
0.0,
0.0
],
[
[
[
3
],
[
[
"_key",
"ShortText"
],
[
"price",
"UInt32"
],
[
"comment",
"UInt32"
],
[
"nth_record",
"UInt32"
]
],
[
"item1",
200,
10,
1
],
[
"item2",
100,
30,
3
],
[
"item3",
300,
20,
2
]
]
]
]
24 changes: 24 additions & 0 deletions test/command/suite/select/cache/columns/window_sort_keys.test
@@ -0,0 +1,24 @@
table_create Items TABLE_HASH_KEY ShortText
column_create Items price COLUMN_SCALAR UInt32
column_create Items comment COLUMN_SCALAR UInt32

load --table Items
[
{"_key": "item1", "price": 200, "comment": 10},
{"_key": "item2", "price": 100, "comment": 30},
{"_key": "item3", "price": 300, "comment": 20}
]

select Items \
--columns[nth_record].stage initial \
--columns[nth_record].value 'record_number()' \
--columns[nth_record].type UInt32 \
--columns[nth_record].window.sort_keys price \
--output_columns '_key, price, comment, nth_record'

select Items \
--columns[nth_record].stage initial \
--columns[nth_record].value 'record_number()' \
--columns[nth_record].type UInt32 \
--columns[nth_record].window.sort_keys comment \
--output_columns '_key, price, comment, nth_record'

0 comments on commit c4bf8fb

Please sign in to comment.