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: Use enum to represent CAST eval_mode in expr.proto #361

Open
andygrove opened this issue May 1, 2024 · 9 comments · May be fixed by #415
Open

chore: Use enum to represent CAST eval_mode in expr.proto #361

andygrove opened this issue May 1, 2024 · 9 comments · May be fixed by #415
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@andygrove
Copy link
Member

What is the problem the feature request solves?

When I added eval_mode to the Cast message in expr.proto I defined it as a string but it should really be an enum.

enum EvalMode {
  LEGACY = 0;
  TRY = 1;
  ANSI = 2;
}

Describe the potential solution

No response

Additional context

No response

@andygrove andygrove added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels May 1, 2024
@prashantksharma
Copy link

prashantksharma commented May 1, 2024

@andygrove

Thank you for the issue description.

I would like to work on this issue. If no one else is working on it.
Can I take it up ?

@viirya
Copy link
Member

viirya commented May 1, 2024

Definitely yes. Thanks @prashantksharma

@parthchandra
Copy link
Contributor

I suppose for this issue it is okay to violate the rule to not modify a field in a protobuf message because we haven't published anything yet.

@andygrove
Copy link
Member Author

I suppose for this issue it is okay to violate the rule to not modify a field in a protobuf message because we haven't published anything yet.

Yes, absolutely.

prashantksharma pushed a commit to prashantksharma/datafusion-comet that referenced this issue May 4, 2024
@prashantksharma
Copy link

prashantksharma commented May 4, 2024

@andygrove , cc: @viirya

Minor Query before opening PR

Summary:

  • Have made changes to expr.proto and QueryPlanSerde.scala. The changes have been pushed to a separate branch on my fork. The comparison can be seen here:
  • make test-rust gives following error.

Screenshot 2024-05-04 at 16 15 58

Minor Query:
Before opening the PR, I would like to confirm: if I should go ahead and resolve the error for planner.rs or a separate issue needs to be created for this ?

@andygrove
Copy link
Member Author

On the Rust side you will need a match statement to convert the protobuf i32 to the Rust enum (0 -> legacy, 1 -> try, 2 -> ansi). Perhaps take a look at how we handle one of the other enums defined in the proto and follow the same pattern?

@andygrove
Copy link
Member Author

@prashantksharma also, feel free to create a draft PR as it can be easier for maintainers to make suggestions on the PR

@prashantksharma
Copy link

prashantksharma commented May 5, 2024

@andygrove

Thank you so much for your feedback:

On the Rust side you will need a match statement to convert the protobuf i32 to the Rust enum (0 -> legacy, 1 -> try, 2 -> ansi). Perhaps take a look at how we handle one of the other enums defined in the proto and follow the same pattern?

I will make necessary changes based on my understanding of the above comment by you.

And, Thank you for your suggesting creation of draft PR, after making necessary updates, I will do that.

@prashantksharma
Copy link

@andygrove cc: @viirya

I have opended a draft PR.

I have tested the changes using

  • make test-rust
  • make test-jvm

Details on PR message:#415

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants