Skip to content

[#8940] improvement(core): Support serialize/deserialize for distributionImpl and sortOrderImpl#8975

Merged
jerryshao merged 7 commits intoapache:branch-lance-namepspace-devfrom
yuqi1129:issue_8940
Nov 4, 2025
Merged

[#8940] improvement(core): Support serialize/deserialize for distributionImpl and sortOrderImpl#8975
jerryshao merged 7 commits intoapache:branch-lance-namepspace-devfrom
yuqi1129:issue_8940

Conversation

@yuqi1129
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • Add serializer and deserializer for class DistributionImpl and SortOrderImpl
  • Optimize sortOrderImpl serialization.

Why are the changes needed?

It's a improvment.

Fix: #8940

Does this PR introduce any user-facing change?

N/A.

How was this patch tested?

UTs and ITs.

gen.writeEndObject();
}

private static void writeExpression(Expression expression, JsonGenerator gen) throws IOException {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess the implementation is quite similar to xxxDTO serde, maybe we can reuse the code. Otherwise, we have to change twice.

Another solution is that when we store these into the database, we can convert the xxxImpl to xxxDTO, and then using the existing serde method to do the serialization and deserialization. With this, we don't have to implement the serde method for these xxxImpl.

What do you think @yuqi1129 @mchades ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the first edition, I have just converted Impl to DTO and reused the DTO serializer and deserializer to handle it. However, since DTO and Impl play different roles, I chose to create new serializers finally. Theoretically, both are okay.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's do the second one if there's no objection, cc @mchades .

Comment thread api/src/main/java/org/apache/gravitino/rel/indexes/Indexes.java Outdated
Comment thread common/src/test/java/org/apache/gravitino/json/TestSerializer.java Outdated
@jerryshao jerryshao merged commit 8782b30 into apache:branch-lance-namepspace-dev Nov 4, 2025
26 checks passed
jerryshao pushed a commit to jerryshao/gravitino that referenced this pull request Nov 11, 2025
…stributionImpl and sortOrderImpl (apache#8975)

### What changes were proposed in this pull request?

- Add serializer and deserializer for class `DistributionImpl` and
`SortOrderImpl`
- Optimize sortOrderImpl serialization.

### Why are the changes needed?

It's a improvment.

Fix: apache#8940 

### Does this PR introduce _any_ user-facing change?

N/A.

### How was this patch tested?

UTs and ITs.
youngyjd pushed a commit to youngyjd/gravitino that referenced this pull request Nov 21, 2025
…stributionImpl and sortOrderImpl (apache#8975)

### What changes were proposed in this pull request?

- Add serializer and deserializer for class `DistributionImpl` and
`SortOrderImpl`
- Optimize sortOrderImpl serialization.

### Why are the changes needed?

It's a improvment.

Fix: apache#8940 

### Does this PR introduce _any_ user-facing change?

N/A.

### How was this patch tested?

UTs and ITs.
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