Aggregation JSON TAG Field not working
Describe the bug i am using json, i am aggregating data but when i groupby TAG field is not working, Number field is still working
To Reproduce
Steps to reproduce the behavior:
Query records using FT.aggregate junna-idx '*' GROUPBY 1 $.title REDUCE count 0 as count_title
See result (nil) value
Environment (please complete the following information):
- OS: [ubuntu 20.04]
- Dragonfly Version: df-v1.22.2
Hi @canparam , the bug you found has already been fixed. And the fix will be released in the next version
Hi @canparam , the bug you found has already been fixed. And the fix will be released in the next version
Thank @BagritsevichStepan , but after I updated and used Aggregation the service was down
version
redis_version:6.2.11
dragonfly_version:df-v1.23.1
redis_mode:standalone
arch_bits:64
os:Linux 4.4.0-22621-Microsoft x86_64
multiplexing_api:epoll
tcp_port:6380
thread_count:8
uptime_in_seconds:11
uptime_in_days:0```
querry:
127.0.0.1:6380> ft.AGGREGATE sales-orders-idx '*' GROUPBY 1 @vid reduce count 0 as kk Error: Server closed the connection not connected>
log error
```W20241001 10:41:52.321777 332 main_service.cc:1437] COMMAND DOCS failed with reason: syntax error
F20241001 10:42:50.749950 333 transaction.cc:653] Unexpected exception Not a double
*** Check failure stack trace: ***
F20241001 10:42:50.749958 339 transaction.cc:653] Unexpected exception Not a double
*** Check failure stack trace: ***
F20241001 10:42:50.749958 339 transaction.cc:653] Unexpected exception Not a doubleF20241001 10:42:50.749961 335 transaction.cc:653] Unexpected exception Not a double
@ 0x7fa6c609d343 (unknown)
*** Check failure stack trace: ***
@ 0x7fa6c609d343 (unknown)
F20241001 10:42:50.749958 339 transaction.cc:653] Unexpected exception Not a doubleF20241001 10:42:50.749961 335 transaction.cc:653] Unexpected exception Not a doubleF20241001 10:42:50.749960 336 transaction.cc:653] Unexpected exception Not a double
@ 0x7fa6c6095b07 (unknown)
*** Check failure stack trace: ***
F20241001 10:42:50.749958 339 transaction.cc:653] Unexpected exception Not a doubleF20241001 10:42:50.749961 335 transaction.cc:653] Unexpected exception Not a doubleF20241001 10:42:50.749960 336 transaction.cc:653] Unexpected exception Not a doubleF20241001 10:42:50.749962 337 transaction.cc:653] Unexpected exception Not a double
@ 0x7fa6c6095b07 (unknown)
@ 0x7fa6c609d343 (unknown)
@ 0x7fa6c609d343 (unknown)
@ 0x7fa6c609748f (unknown)
*** Check failure stack trace: ***
F20241001 10:42:50.749958 339 transaction.cc:653] Unexpected exception Not a doubleF20241001 10:42:50.749961 335 transaction.cc:653] Unexpected exception Not a doubleF20241001 10:42:50.749960 336 transaction.cc:653] Unexpected exception Not a doubleF20241001 10:42:50.749962 337 transaction.cc:653] Unexpected exception Not a doubleF20241001 10:42:50.750264 338 transaction.cc:653] Unexpected exception Not a double
@ 0x7fa6c609748f (unknown)
@ 0x7fa6c6095b07 (unknown)
@ 0x7fa6c55e93e6 (unknown)
@ 0x7fa6c6095b07 (unknown)
*** Check failure stack trace: ***
@ 0x7fa6c609d343 (unknown)
@ 0x7fa6c55e93e6 (unknown)
@ 0x7fa6c609748f (unknown)```
Can you please provide a minimal reproducible example or share with us the snapshot?
Can you please provide a minimal reproducible example or share with us the snapshot?
Yes, I found out when I AGGREGATE but any field with data equal to null will error both v1.23.1 and v1.23.0 are buggy
can you create data
127.0.0.1:6379> json.set test:dfly:1 $ '{"name":"John","age":12, "id": null}'
OK
127.0.0.1:6379> json.set test:dfly:2 $ '{"name":"David","age":12, "id": null}'
OK
127.0.0.1:6379> json.set test:dfly:3 $ '{"name":"David","age":12, "id": 1}'
OK
127.0.0.1:6379> FT.CREATE test-dfly ON JSON PREFIX 1 test:dfly: SCHEMA $.name AS name TAG $.age AS age NUMERIC SORTABLE $.id as id NUMERIC
(error) ERR Index already exists
127.0.0.1:6379> ft.dropindex test-dfly
OK
127.0.0.1:6379> FT.CREATE test-dfly ON JSON PREFIX 1 test:dfly: SCHEMA $.name AS name TAG $.age AS age NUMERIC SORTABLE $.id as id NUMERIC
OK
127.0.0.1:6379> ft.aggregate test-dfly "*" GROUPBY 1 @name REDUCE COUNT 0 as num
query image
error image
Thanks!
Since #4070 merged, crashes no longer occur. However, now we need to add support for nullable fields, as FT.SEARCH and FT.AGGREGATE currently don’t index documents with null values. Another issue #4107 has been created to track the progress.
@BagritsevichStepan thanks! regarding nullable values - is it a regression compared to 1.24?
No, in the 1.24 Dragonfly crashed if a field had a null value