Navigation Menu

Skip to content

Commit

Permalink
test: add drilldowns[LABEL].columns[NAME].type 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 5bbd630
Show file tree
Hide file tree
Showing 2 changed files with 303 additions and 0 deletions.
263 changes: 263 additions & 0 deletions test/command/suite/select/cache/drilldowns/columns/type.expected
@@ -0,0 +1,263 @@
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'
[
[
0,
0.0,
0.0
],
[
[
[
3
],
[
[
"_id",
"UInt32"
],
[
"_key",
"ShortText"
],
[
"items",
"Items"
]
],
[
1,
"Stationery store",
[
"Book",
"Note",
"Box",
"Pen"
]
],
[
2,
"Supermarket",
[
"Food",
"Drink",
"Pen"
]
],
[
3,
"Convenience store",
[
"Pen",
"Note",
"Food",
"Drink"
]
]
],
{
"item": [
[
6
],
[
[
"_key",
"ShortText"
],
[
"_nsubrecs",
"Int32"
],
[
"price",
"UInt32"
],
[
"price_with_tax",
"UInt32"
]
],
[
"Drink",
2,
300,
324
],
[
"Food",
2,
500,
540
],
[
"Pen",
3,
500,
540
],
[
"Box",
1,
500,
540
],
[
"Book",
1,
1000,
1080
],
[
"Note",
2,
1000,
1080
]
]
}
]
]
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 ShortText --drilldowns[item].columns[price_with_tax].flags COLUMN_SCALAR --drilldowns[item].columns[price_with_tax].value 'price * 1.08'
[
[
0,
0.0,
0.0
],
[
[
[
3
],
[
[
"_id",
"UInt32"
],
[
"_key",
"ShortText"
],
[
"items",
"Items"
]
],
[
1,
"Stationery store",
[
"Book",
"Note",
"Box",
"Pen"
]
],
[
2,
"Supermarket",
[
"Food",
"Drink",
"Pen"
]
],
[
3,
"Convenience store",
[
"Pen",
"Note",
"Food",
"Drink"
]
]
],
{
"item": [
[
6
],
[
[
"_key",
"ShortText"
],
[
"_nsubrecs",
"Int32"
],
[
"price",
"UInt32"
],
[
"price_with_tax",
"ShortText"
]
],
[
"Drink",
2,
300,
"324.0"
],
[
"Food",
2,
500,
"540.0"
],
[
"Pen",
3,
500,
"540.0"
],
[
"Box",
1,
500,
"540.0"
],
[
"Book",
1,
1000,
"1080.0"
],
[
"Note",
2,
1000,
"1080.0"
]
]
}
]
]
40 changes: 40 additions & 0 deletions test/command/suite/select/cache/drilldowns/columns/type.test
@@ -0,0 +1,40 @@
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'

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 ShortText \
--drilldowns[item].columns[price_with_tax].flags COLUMN_SCALAR \
--drilldowns[item].columns[price_with_tax].value 'price * 1.08'

0 comments on commit 5bbd630

Please sign in to comment.