Skip to content

Conversation

@plusplusjiajia
Copy link
Member

Purpose

Add Predicate and Transform json serialization utils

@JingsongLi
Copy link
Contributor

If possible, we'd better encapsulate the JSON serialization into specific classes, as this is the most effective way to avoid omissions.

@plusplusjiajia
Copy link
Member Author

If possible, we'd better encapsulate the JSON serialization into specific classes, as this is the most effective way to avoid omissions.

Excellent suggestion!

@plusplusjiajia plusplusjiajia changed the title [core]Add JSON serialization support for Predicate and Transform [core] Add JSON serialization support for Predicate and Transform Jan 10, 2026
@plusplusjiajia plusplusjiajia force-pushed the predicate-parse branch 5 times, most recently from 5d8a1fe to c9895bf Compare January 10, 2026 11:25
@plusplusjiajia
Copy link
Member Author

e'd better encapsulate the JSON serialization into specific classes
Thanks for your advise! I've made the changes according to your advise. Please review it when you have a chance.


private static Predicate roundTrip(Predicate predicate) {
String json = JsonSerdeUtil.toFlatJson(predicate);
return JsonSerdeUtil.fromJson(json, Predicate.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have JSON expected result in the tests? This is a standard. We need to solidify serialization-related issues in the test at least.

Copy link
Contributor

Choose a reason for hiding this comment

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

Something like DataTypeJsonParserTest.

Copy link
Member Author

Choose a reason for hiding this comment

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

DataTypeJsonParserTest

Thansk for you review. It's really a useful suggestion, I've updated the test.

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

Only two types: leaf and compound, TransformPredicate should be leaf type too.

  1. type leaf: transform, function and literals.
  2. type compound: function and children.

@JingsongLi
Copy link
Contributor

I try to unify them in #7015

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.

2 participants