-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
exec: 'index out of range' errors for some aggregations #38750
Comments
Tracking some findings so far: The table in the example looks like this
I believe many of the other failures have to do with the presence of NULLs in the group columns. The offending line is accessing
One interesting thing is that |
Noting this down here so I don't forget over the weekend -- Removing the line |
Here's the explanation: the hashTable data structure is shared between the hash joiner and the hash aggregator. It was originally implemented for the hash joiner, and in that case, NULLs are always supposed to be treated as non-equal. However, in the hash aggregator, we want NULLs to compare as equal to each other. I'll put up a PR with an attempted fix. |
38900: exec: handle NULL group by keys in hash aggregator r=rafiss a=rafiss Previously, if an aggregation was requested with NULL group keys, an index out of bounds error would occur in the hash aggregator. The reason was that the hashTable data structure is shared between the hash joiner and the hash aggregator. It was originally implemented for the hash joiner, and in that case, NULLs are always supposed to be treated as non-equal. However, in the hash aggregator, we want NULLs to compare as equal to each other. This change allows the tests in logic_test/aggregate to pass with the local-vec configuration. In order to exercise more of the null handling logic, the tests now set garbage data in the corresponing position of the vector whenever an element is null. fixes #38750 Release note: None Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com>
Some aggregations cause an "index out of range" error in the vectorized implementation. You can see examples of this by running the
aggregate
logic test with thelocal-vec
configuration. Some of the failing tests:The text was updated successfully, but these errors were encountered: