Skip to content

Group By does not support complex expression #262

@xlxie

Description

@xlxie

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions