File: columns.test

package info (click to toggle)
groonga 16.0.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 188,416 kB
  • sloc: ansic: 772,827; cpp: 52,396; ruby: 40,556; javascript: 10,250; yacc: 7,045; sh: 5,627; python: 2,821; makefile: 1,679
file content (39 lines) | stat: -rw-r--r-- 1,082 bytes parent folder | download | duplicates (4)
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