taiyang-li opened a new issue, #9178: URL: https://github.com/apache/incubator-gluten/issues/9178
### Backend CH (ClickHouse) ### Bug description Maybe caused by https://github.com/apache/incubator-gluten/pull/8376/files `hash(id)` could not be extracted as common subexpression after this PR. ``` sql 0: jdbc:hive2://localhost:10000/> explain extended select id % 2, max(hash(id)), min(hash(id)) from range(10) group by id % 2 . . . . . . . . . . . . . . . . > ; +----------------------------------------------------+ | plan | +----------------------------------------------------+ | == Parsed Logical Plan == 'Aggregate [('id % 2)], [unresolvedalias(('id % 2), None), unresolvedalias('max('hash('id)), None), unresolvedalias('min('hash('id)), None)] +- 'UnresolvedTableValuedFunction range, [10] == Analyzed Logical Plan == (id % 2): bigint, max(hash(id)): int, min(hash(id)): int Aggregate [(id#1798L % cast(2 as bigint))], [(id#1798L % cast(2 as bigint)) AS (id % 2)#1801L, max(hash(id#1798L, 42)) AS max(hash(id))#1802, min(hash(id#1798L, 42)) AS min(hash(id))#1803] +- Range (0, 10, step=1, splits=None) == Optimized Logical Plan == Aggregate [_groupingexpression#1804L], [_groupingexpression#1804L AS (id % 2)#1801L, max(hash(id#1798L, 42)) AS max(hash(id))#1802, min(hash(id#1798L, 42)) AS min(hash(id))#1803] +- Project [id#1798L, (id#1798L % 2) AS _groupingexpression#1804L] +- Range (0, 10, step=1, splits=None) == Physical Plan == CHNativeColumnarToRow +- ^(163) HashAggregateTransformer(keys=[_groupingexpression#1804L], functions=[max(_pre_80#1810), min(_pre_80#1810)], isStreamingAgg=false, output=[(id % 2)#1801L, max(hash(id))#1802, min(hash(id))#1803]) +- ^(163) ProjectExecTransformer [(id#1798L % 2) AS _groupingexpression#1804L, hash(id#1798L, 42) AS _pre_80#1810] +- ^(163) CHRangeExecTransformer 0, 10, 1, 1, 10, [id#1798L] | +----------------------------------------------------+ ``` ### Spark version None ### Spark configurations _No response_ ### System information _No response_ ### Relevant logs ```bash ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
