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-7581][CORE] Code cleanup for GlutenColumnarRule #7582

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

beliefer
Copy link
Contributor

What changes were proposed in this pull request?

This PR proposes to make code cleanup for GlutenColumnarRule.

How was this patch tested?

integration tests

@github-actions github-actions bot added the CORE works for Gluten Core label Oct 17, 2024
Copy link

#7581

Copy link

Run Gluten Clickhouse CI

val applier = applierBuilder.apply(session)
val out = applier.apply(vanillaPlan, outputsColumnar)
out
applier.apply(vanillaPlan, outputsColumnar)
Copy link
Member

Choose a reason for hiding this comment

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

val out = ...
out

This code pattern is used usually because out allows developer to place a breakpoint for debugging against the output object easily. Do you happen to know an alternative way if we simplify the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I understood it. We usually avoid this code pattern in Spark. Developers could evaluate the expression (e.g. out) if who want know the value.
Of course, I will respect the code pattern if Gluten has the preference.

Copy link
Member

Choose a reason for hiding this comment

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

Let's do the simplification. Just found there is an alternative way while using Intellij IDE. Thanks.

(child, false)
case _ =>
throw new IllegalStateException(
"This should not happen. Please leave a issue at" +
Copy link
Member

Choose a reason for hiding this comment

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

Can you help change a issue to an issue in passing? Thanks.

val outputsColumnar = OutputsColumnarTester.inferOutputsColumnar(plan)
val unwrapped = OutputsColumnarTester.unwrap(plan)
val vanillaPlan = Transitions.insertTransitions(unwrapped, outputsColumnar)
val (childPlan, outputsColumnar) = plan match {
Copy link
Member

Choose a reason for hiding this comment

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

Will renaming childPlan to originalPlan or similar help user to understand the code?

Copy link

Run Gluten Clickhouse CI

Copy link

Run Gluten Clickhouse CI

Copy link

Run Gluten Clickhouse CI

@beliefer beliefer changed the title [GLUTEN-7581][VL] Code cleanup for GlutenColumnarRule [GLUTEN-7581][CORE] Code cleanup for GlutenColumnarRule Oct 19, 2024
Copy link

Run Gluten Clickhouse CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CORE works for Gluten Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants