Navigation Menu

Skip to content

Commit

Permalink
WIP test: add drilldowns[LABEL].columns[NAME].window.sort_keys withou…
Browse files Browse the repository at this point in the history
…t cache

Wrong usage of window.sort_keys?
  • Loading branch information
kenhys committed Apr 14, 2017
1 parent eb8f465 commit 9c85153
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
@@ -0,0 +1,64 @@
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]
table_create Shops TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
column_create Shops items COLUMN_VECTOR Items
[[0,0.0,0.0],true]
load --table Shops
[
{"_key": "Stationery store", "items": ["Book", "Note", "Box", "Pen"]},
{"_key": "Supermarket", "items": ["Food", "Drink", "Pen"]},
{"_key": "Convenience store", "items": ["Pen", "Note","Food", "Drink"]}
]
[[0,0.0,0.0],3]
load --table Items
[
{"_key": "Book", "price": 1000},
{"_key": "Note", "price": 1000},
{"_key": "Box", "price": 500},
{"_key": "Pen", "price": 500},
{"_key": "Food", "price": 500},
{"_key": "Drink", "price": 300}
]
[[0,0.0,0.0],6]
select Shops --drilldowns[item].keys items --drilldowns[item].sortby price --drilldowns[item].output_columns _key,_nsubrecs,price,price_with_tax --drilldowns[item].columns[price_with_tax].stage initial --drilldowns[item].columns[price_with_tax].type UInt32 --drilldowns[item].columns[price_with_tax].flags COLUMN_SCALAR --drilldowns[item].columns[price_with_tax].value 'price * 1.08' --drilldowns[item].columns[price_with_tax].window.sort_keys _key
[
[
[
-22,
0.0,
0.0
],
"[table][apply][window-function] must be window function call: #<expr\n vars:{\n $1:#<record:hash:(anonymous:2147483649) id:(n"
],
[

]
]
#|e| [table][apply][window-function] must be window function call: #<expr
vars:{
$1:#<record:hash:(anonymous:2147483649) id:(no value)>,
$condition:#<ptr:(NULL)>
},
codes:{
0:<get_value n_args:1, flags:0, modify:2, value:#<accessor _key(anonymous).price(Items)>>,
1:<push n_args:1, flags:0, modify:0, value:1.08>,
2:<star n_args:2, flags:0, modify:0, value:(NULL)>
}
>
select Shops --drilldowns[item].keys items --drilldowns[item].sortby price --drilldowns[item].output_columns _key,_nsubrecs,price,price_with_tax --drilldowns[item].columns[price_with_tax].stage initial --drilldowns[item].columns[price_with_tax].type UInt32 --drilldowns[item].columns[price_with_tax].flags COLUMN_SCALAR --drilldowns[item].columns[price_with_tax].value 'price * 1.08' --drilldowns[item].columns[price_with_tax].window.sort_keys price
[
[
[
-22,
0.0,
0.0
],
"[table][apply][window-function] must be window function call: #<expr\n vars:{\n $1:#<record:hash:(anonymous:2147483649) id:(n"
],
[

]
]
@@ -0,0 +1,42 @@
table_create Items TABLE_HASH_KEY ShortText
column_create Items price COLUMN_SCALAR UInt32

table_create Shops TABLE_HASH_KEY ShortText
column_create Shops items COLUMN_VECTOR Items

load --table Shops
[
{"_key": "Stationery store", "items": ["Book", "Note", "Box", "Pen"]},
{"_key": "Supermarket", "items": ["Food", "Drink", "Pen"]},
{"_key": "Convenience store", "items": ["Pen", "Note","Food", "Drink"]}
]

load --table Items
[
{"_key": "Book", "price": 1000},
{"_key": "Note", "price": 1000},
{"_key": "Box", "price": 500},
{"_key": "Pen", "price": 500},
{"_key": "Food", "price": 500},
{"_key": "Drink", "price": 300}
]

select Shops \
--drilldowns[item].keys items \
--drilldowns[item].sortby price \
--drilldowns[item].output_columns _key,_nsubrecs,price,price_with_tax \
--drilldowns[item].columns[price_with_tax].stage initial \
--drilldowns[item].columns[price_with_tax].type UInt32 \
--drilldowns[item].columns[price_with_tax].flags COLUMN_SCALAR \
--drilldowns[item].columns[price_with_tax].value 'price * 1.08' \
--drilldowns[item].columns[price_with_tax].window.sort_keys _key

select Shops \
--drilldowns[item].keys items \
--drilldowns[item].sortby price \
--drilldowns[item].output_columns _key,_nsubrecs,price,price_with_tax \
--drilldowns[item].columns[price_with_tax].stage initial \
--drilldowns[item].columns[price_with_tax].type UInt32 \
--drilldowns[item].columns[price_with_tax].flags COLUMN_SCALAR \
--drilldowns[item].columns[price_with_tax].value 'price * 1.08' \
--drilldowns[item].columns[price_with_tax].window.sort_keys price

0 comments on commit 9c85153

Please sign in to comment.