Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FT.AGGREGATE command does not handle index fields correctly #3659

Closed
BagritsevichStepan opened this issue Sep 5, 2024 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@BagritsevichStepan
Copy link
Contributor

BagritsevichStepan commented Sep 5, 2024

Describe the bug
FT.AGGREGATE command does not handle index fields correctly. Some examples:

Initialize:

127.0.0.1:6379> hset key:1 word item1 foo 10 text "first key"
(integer) 3
127.0.0.1:6379> hset key:2 word item2 foo 20 text "second key"
(integer) 3
127.0.0.1:6379> ft.create index on hash schema word TAG foo NUMERIC text TEXT
OK
  1. Dragonfly:
127.0.0.1:6379> ft.aggregate index "*" LOAD 2 foo text GROUPBY 2 @word @text REDUCE SUM 1 @foo AS foo_total
1) (integer) 2
2) 1) "text"
   2) "second key"
   3) "word"
   4) (nil)
   5) "foo_total"
   6) "20"
3) 1) "text"
   2) "first key"
   3) "word"
   4) (nil)
   5) "foo_total"
   6) "10"

Redis:

127.0.0.1:6379> ft.aggregate index "*" LOAD 2 foo text GROUPBY 2 @word @text REDUCE SUM 1 @foo AS foo_total
1) (integer) 2
2) 1) "word"
   2) "item2"
   3) "text"
   4) "second key"
   5) "foo_total"
   6) "20"
3) 1) "word"
   2) "item1"
   3) "text"
   4) "first key"
   5) "foo_total"
   6) "10"
  1. Dragonlfy:
127.0.0.1:6379> ft.aggregate index "*" LOAD 1 @word GROUPBY 1 @word REDUCE SUM 1 @foo AS foo_total
1) (integer) 2
2) 1) "word"
   2) "item2"
   3) "foo_total"
   4) "0"
3) 1) "word"
   2) "item1"
   3) "foo_total"
   4) "0"

Redis:

1) (integer) 2
2) 1) "word"
   2) "item1"
   3) "foo_total"
   4) "10"
3) 1) "word"
   2) "item2"
   3) "foo_total"
   4) "20"
@BagritsevichStepan BagritsevichStepan added the bug Something isn't working label Sep 5, 2024
@BagritsevichStepan BagritsevichStepan self-assigned this Sep 5, 2024
@dragonflydb dragonflydb deleted a comment Sep 5, 2024
BagritsevichStepan added a commit to BagritsevichStepan/dragonfly that referenced this issue Oct 21, 2024
…GATE commands

fixes dragonflydb#3782, dragonflydb#3659

Signed-off-by: Stsiapan Bahrytsevich <stefan@dragonflydb.io>
BagritsevichStepan added a commit to BagritsevichStepan/dragonfly that referenced this issue Oct 27, 2024
…GATE commands

fixes dragonflydb#3782, dragonflydb#3659

Signed-off-by: Stsiapan Bahrytsevich <stefan@dragonflydb.io>
BagritsevichStepan added a commit to BagritsevichStepan/dragonfly that referenced this issue Oct 27, 2024
…GATE commands

fixes dragonflydb#3782, dragonflydb#3659

Signed-off-by: Stsiapan Bahrytsevich <stefan@dragonflydb.io>
BagritsevichStepan added a commit that referenced this issue Oct 27, 2024
…GATE commands (#3955)

fixes #3782, #3659

Signed-off-by: Stsiapan Bahrytsevich <stefan@dragonflydb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant