1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
table_create Items TABLE_HASH_KEY ShortText
column_create Items price COLUMN_SCALAR UInt32
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}
]
# To use cache
#@sleep 1
#@collect-query-log true
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'
#@sleep 1
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'
# There are more spaces around '*' in --columns[price_with_tax].value
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'
#@collect-query-log false
|