You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The group by operation does not support complex expression as the group by key. For example, group by (case when column1 is null)...
Version
Reproducible on all versions.
Steps to Reproduce
select case when column1 is null then 'null_value' else column end, max(column2) group by case when column1 is null then 'null_value' else column1 end
Reasons
I tried to find out the behind reason. An exception was thrown at Utils.scala:1464. The serializer treefold the CASE WHEN expression and tried to look for column1 in the output list of the sub-executor and it failed.
Finally, I found the root cause is at strategies.scala:177-234. When the optimizer generates the plan for encrypted SQL, it generates multiple executors for one AGG executor. And it simply passes the group by key of the original AGG executor to other nodes. As such, for some of the generated executors, the serializer failed to find the input of the executors from the sub-executor's output.
The text was updated successfully, but these errors were encountered:
@xlxie I just took a look, and it does seem that our aggregates do not support complex expressions as group keys for that exact reason. Would you be interested in submitting a PR with the fix? Happy to help debug, offer advice, and review!
Summary of Bug
The group by operation does not support complex expression as the group by key. For example, group by (case when column1 is null)...
Version
Reproducible on all versions.
Steps to Reproduce
select case when column1 is null then 'null_value' else column end, max(column2) group by case when column1 is null then 'null_value' else column1 end
Reasons
I tried to find out the behind reason. An exception was thrown at Utils.scala:1464. The serializer treefold the CASE WHEN expression and tried to look for column1 in the output list of the sub-executor and it failed.
Finally, I found the root cause is at strategies.scala:177-234. When the optimizer generates the plan for encrypted SQL, it generates multiple executors for one AGG executor. And it simply passes the group by key of the original AGG executor to other nodes. As such, for some of the generated executors, the serializer failed to find the input of the executors from the sub-executor's output.
The text was updated successfully, but these errors were encountered: