Navigation Menu

Skip to content

Commit

Permalink
test: add columns[NAME].stage test case without cache
Browse files Browse the repository at this point in the history
TODO: confirm the value of price_with_tax
  • Loading branch information
kenhys committed Apr 14, 2017
1 parent eb8f465 commit bcf77c5
Show file tree
Hide file tree
Showing 2 changed files with 163 additions and 0 deletions.
132 changes: 132 additions & 0 deletions test/command/suite/select/cache/columns/stage.expected
@@ -0,0 +1,132 @@
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 Prices TABLE_PAT_KEY UInt32
[[0,0.0,0.0],true]
column_create Prices item_index COLUMN_INDEX Items price
[[0,0.0,0.0],true]
load --table Items
[
{"_key": "Book", "price": 1000},
{"_key": "Note", "price": 1000},
{"_key": "Box", "price": 520},
{"_key": "Pen", "price": 510},
{"_key": "Food", "price": 500},
{"_key": "Drink", "price": 300}
]
[[0,0.0,0.0],6]
select Items --columns[price_with_tax].stage initial --columns[price_with_tax].type UInt32 --columns[price_with_tax].flags COLUMN_SCALAR --columns[price_with_tax].value 'price * 1.08' --filter 'price >= 510' --sort_keys _id
[
[
0,
0.0,
0.0
],
[
[
[
4
],
[
[
"_id",
"UInt32"
],
[
"_key",
"ShortText"
],
[
"price_with_tax",
"UInt32"
],
[
"price",
"UInt32"
]
],
[
1,
"Book",
1080,
1000
],
[
2,
"Note",
1080,
1000
],
[
3,
"Box",
561,
520
],
[
4,
"Pen",
550,
510
]
]
]
]
select Items --columns[price_with_tax].stage filtered --columns[price_with_tax].type UInt32 --columns[price_with_tax].flags COLUMN_SCALAR --columns[price_with_tax].value 'price * 1.08' --filter 'price >= 510' --sort_keys _id
[
[
0,
0.0,
0.0
],
[
[
[
4
],
[
[
"_id",
"UInt32"
],
[
"_key",
"ShortText"
],
[
"price_with_tax",
"UInt32"
],
[
"price",
"UInt32"
]
],
[
1,
"Book",
550,
1000
],
[
2,
"Note",
561,
1000
],
[
3,
"Box",
1080,
520
],
[
4,
"Pen",
1080,
510
]
]
]
]
31 changes: 31 additions & 0 deletions test/command/suite/select/cache/columns/stage.test
@@ -0,0 +1,31 @@
table_create Items TABLE_HASH_KEY ShortText
column_create Items price COLUMN_SCALAR UInt32

table_create Prices TABLE_PAT_KEY UInt32
column_create Prices item_index COLUMN_INDEX Items price

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

select Items \
--columns[price_with_tax].stage initial \
--columns[price_with_tax].type UInt32 \
--columns[price_with_tax].flags COLUMN_SCALAR \
--columns[price_with_tax].value 'price * 1.08' \
--filter 'price >= 510' \
--sort_keys _id

select Items \
--columns[price_with_tax].stage filtered \
--columns[price_with_tax].type UInt32 \
--columns[price_with_tax].flags COLUMN_SCALAR \
--columns[price_with_tax].value 'price * 1.08' \
--filter 'price >= 510' \
--sort_keys _id

0 comments on commit bcf77c5

Please sign in to comment.