【发布时间】:2016-03-30 15:27:08
【问题描述】:
无法理解为什么 aggregateQuery 总是返回空结果。尝试在aql中测试,同样的问题:集合中的0行。
索引都在那里。
aql> show indexes
+---------------+-------------+-----------+------------+-------+------------------------------+-------------+------------+-----------+
| ns | bin | indextype | set | state | indexname | path | sync_state | type |
+---------------+-------------+-----------+------------+-------+------------------------------+-------------+------------+-----------+
| "test" | "name" | "NONE" | "profiles" | "RW" | "inx_test_name" | "name" | "synced" | "STRING" |
| "test" | "age" | "NONE" | "profiles" | "RW" | "inx_test_age" | "age" | "synced" | "NUMERIC" |
aql> select * from test.profiles
+---------+-----+
| name | age |
+---------+-----+
| "Sally" | 19 |
| 20 | |
| 22 | |
| 28 | |
| "Ann" | 22 |
| "Bob" | 22 |
| "Tammy" | 22 |
| "Ricky" | 20 |
| 22 | |
| 19 | |
+---------+-----+
10 rows in set (0.026 secs)
aql> AGGREGATE mystream.avg_age() ON test.profiles WHERE age BETWEEN 20 and 29
0 rows in set (0.004 secs)
【问题讨论】:
-
你能在不调用udf的情况下通过aql共享lua文件和查询结果吗?
-
你有建立在 age bin 上的索引吗?当你只是
SELECT * FROM test.profiles WHERE age BETWEEN 20 AND 29时会发生什么?此外,您需要展示您的 Lua 模块才能弄清楚这一点。