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

chore: Add CometEvalMode enum to replace string literals #539

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

andygrove
Copy link
Member

Which issue does this PR close?

N/A

Rationale for this change

Code cleanup.

What changes are included in this PR?

  • Add new CometEvalMode
  • Use this enum instead of strings

How are these changes tested?

Existing tests

@andygrove
Copy link
Member Author

These changes were originally part of #509 but it looks like we won't be merging that one for some time

Copy link
Contributor

@kazuyukitanimura kazuyukitanimura left a comment

Choose a reason for hiding this comment

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

LGTM pending ci

Comment on lines 31 to 36
def unhexSerde(unhex: Unhex): (Expression, Expression) = {
(unhex.child, Literal(unhex.failOnError))
}

def evalMode(c: Cast): CometEvalMode.Value =
CometEvalModeUtil.fromSparkEvalMode(c.evalMode)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: it seems to be that we can keep it as protected instead of changing to public?

Also evalMode can be protected?

Copy link
Member Author

Choose a reason for hiding this comment

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

That was an unintenional change. I will revert.

Copy link
Member Author

Choose a reason for hiding this comment

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

@kazuyukitanimura I made these methods protected in all shim versions for consistency

@andygrove andygrove merged commit 311e13e into apache:main Jun 7, 2024
43 checks passed
@andygrove andygrove deleted the cast-eval-enum branch June 7, 2024 21:15
himadripal pushed a commit to himadripal/datafusion-comet that referenced this pull request Sep 7, 2024
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.

3 participants