[groonga-dev,03896] インデックスを使用してbetween関数を使う

Back to archive index

Yutaro SHIMAMURA yu****@irx*****
2016年 2月 2日 (火) 04:37:35 JST


groonga 5.0.9を使ってます!

between関数を使うときに、対象のカラムがTime型/Int型だとうまく実行できない問題にぶつかりました。

table_create idx_time TABLE_PAT_KEY Time
table_create test TABLE_HASH_KEY ShortText
column_create test time COLUMN_SCALAR idx_time
column_create idx_time test_time COLUMN_INDEX test time


load --table test
[
["_key","time"],
["test1",1234567890.12],
["test2",1234567891.12],
["test3",1234567892.12]
]


この内容でbetween関数を使って絞り込みを実行しようとしたところ、between関数内部でエラーになってしまい、実行できませんでした。

> select test --filter 'between(time,1234567890,"include",1234567892,"include")'
[[-22,1454354516.15522,0.000474214553833008,"between(): failed to cast min: <1234567890> -> <idx_time>",[["between_cast","proc.c",5570]]],[]]

試しにidx_timeをUint64で作成して実行しましたが、同じエラーで失敗しました。

[[-22,1454354741.43699,0.000444650650024414,"between(): failed to cast min: <1> -> <idx_time>",[["between_cast","proc.c",5570]]],[]]


この使い方をする場合、なにかテーブル作成時に実行しておくことや、filter条件の書き方を変える必要があるのでしょうか?



groonga-dev メーリングリストの案内
Back to archive index