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

[GLUTEN-6235][CH] Fix crash on ExpandTransform::work() #6238

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

exmy
Copy link
Contributor

@exmy exmy commented Jun 26, 2024

What changes were proposed in this pull request?

The pr #5254 would filter redundant attribute when transforming to substraint plan in order to fix Unexpected empty column exception when reading hive text table. This introduces a new issue, for example:

(1) NativeScan hive tmp.testxmy_expand
Output [11]: [a1#4, a2#5, a3#6, a4#7, a5#8, a6#9, a7#10, a8#11, a3#6, a4#7, a9#12]
Arguments: [a1#4, a2#5, a3#6, a4#7, a5#8, a6#9, a7#10, a8#11, a3#6, a4#7, a9#12], HiveTableRelation [`tmp`.`testxmy_expand`, org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, Data Cols: [a1#4, a2#5, a3#6, a4#7, a5#8, a6#9, a7#10, a8#11, a9#12], Partition Cols: []]

(2) ExpandExecTransformer
Input [11]: [a1#4, a2#5, a3#6, a4#7, a5#8, a6#9, a7#10, a8#11, a3#6, a4#7, a9#12]
Arguments: [[a1#4, a2#5, a3#6, a4#7, a5#8, a6#9, a7#10, a8#11, a3#6, a4#7, a9#12, 0], ....

After filter redundant attribute, the HiveTableScan operator output 7 distinct attributes in substrait read node but its output method still output 9 attributes include 2 duplicated arrtibutes, which causes column index mismatch in following process and crash.

We should keep the HiveTableScan's output attributes unique.

(Fixes: #6235)

How was this patch tested?

Add UT

Copy link

#6235

Copy link

Run Gluten Clickhouse CI

Copy link

Run Gluten Clickhouse CI

Copy link
Contributor

@zzcclp zzcclp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zzcclp zzcclp merged commit 51b1901 into apache:main Jun 27, 2024
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CH] Crash on ExpandTransform::work()
2 participants