-
Notifications
You must be signed in to change notification settings - Fork 84
[Expr Serde] [PR 2/X] Operation type enum conversion helper #534
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
base: main
Are you sure you want to change the base?
Conversation
| // Helper to test round-trip serialization | ||
| // Uses string comparison since expressions may have different internal identity | ||
| // but the same semantic meaning (i.e., ToString() output matches) | ||
| void TestRoundTrip(const Expression& expr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You add this helper function but not used anywhere.
src/iceberg/CMakeLists.txt
Outdated
| expression/expression.cc | ||
| expression/expressions.cc | ||
| expression/inclusive_metrics_evaluator.cc | ||
| expression/json_internal.cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By convention, this file should be named json.cc, as internal is typically reserved for header files. I'm aware that we already have a json_internal.cc, but that’s legacy. I think json_serde.cc/ json_serde_internal.h would be a better choice. What do you think, @wgtmac?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
Summary
This PR is a small change that will be used later. It is a simple string to enum and enum to string conversion. It does not add any functionality
Test
Added a unit tests for one of the case, just to confirm it works.
./build/src/iceberg/test/expression_test --gtest_filter="ExpressionJson*" ✔ 1322 11:28:25
Running main() from gmock_main.cc
Note: Google Test filter = ExpressionJson*
[==========] Running 3 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 3 tests from ExpressionJsonTest
[ RUN ] ExpressionJsonTest.TrueExpression
[ OK ] ExpressionJsonTest.TrueExpression (0 ms)
[ RUN ] ExpressionJsonTest.FalseExpression
[ OK ] ExpressionJsonTest.FalseExpression (0 ms)
[ RUN ] ExpressionJsonTest.OpToString
[ OK ] ExpressionJsonTest.OpToString (0 ms)
[----------] 3 tests from ExpressionJsonTest (0 ms total)
[----------] Global test environment tear-down
[==========] 3 tests from 1 test suite ran. (0 ms total)
[ PASSED ] 3 tests.