Skip to content

Support serializable date buckets in codec-java - #443

Merged
zipdoki merged 2 commits into
mainfrom
fix/codec-java-serializable-metadata
Jul 23, 2026
Merged

zipdoki merged 2 commits into
mainfrom
fix/codec-java-serializable-metadata

Conversation

@eazyhozy

@eazyhozy eazyhozy commented Jul 22, 2026 •

Copy link
Copy Markdown
Member

Summary

At the time of this change, neither main nor codec-java/0.4.x defines date bucket metadata, and the published codec-java 0.4.0 artifact has no Bucket type or Group.Field.bucket. When metadata contains a date bucket, strict deserializers can reject the unknown bucket property and fail to load the metadata, while tolerant deserializers can silently discard the bucket definition. In the latter case, downstream bulk-load or distributed processing can group by raw timestamp values instead of the formatted bucket values expected by the metadata.

This PR adds date bucket metadata support to codec-java group fields and preserves compatibility with 0.4.0-shaped metadata where bucket is missing or explicitly null. It also keeps derived ZoneId and DateTimeFormatter state out of Java serialization and reconstructs that state after deserialization so nested LabelDTO metadata remains usable.

Closes: N/A

This PR is a prerequisite for #397 and should be merged first.

Changes

  • Add date bucket metadata and application to Group.Field.
  • Keep optional buckets compatible with metadata where bucket is missing or null, including strict creator-null checks.
  • Keep derived ZoneId and DateTimeFormatter state out of Java serialization and reconstruct it after deserialization.
  • Cover value-unit conversion, missing/null/date bucket deserialization, and nested LabelDTO Java serialization round trips.

How to Test

  • ./gradlew :codec-java:test --tests com.kakao.actionbase.v2.core.metadata.BucketTests --tests com.kakao.actionbase.v2.core.metadata.LabelDTOTests
  • ./gradlew :codec-java:spotlessCheck

AI Assistance

  • This PR was written largely with AI assistance.
    • Tool / model: Codex / GPT-5.6 SOL

🤖 Generated with Codex (gpt-5.6-sol)

Add date bucket metadata to group fields and keep derived formatting
state out of Java serialization.

Reconstruct transient state after deserialization so nested LabelDTO
metadata remains usable in bulk-load and distributed processing clients.

Tested: :codec-java:test (BucketTests, LabelDTOTests)
Tested: :codec-java:spotlessCheck

🤖 Generated with Codex (gpt-5.5)

Co-Authored-By: Codex <[email protected]>
@eazyhozy eazyhozy self-assigned this Jul 22, 2026
@eazyhozy eazyhozy changed the title fix(codec-java): support serializable date buckets Support serializable date buckets in codec-java Jul 22, 2026
@eazyhozy
eazyhozy marked this pull request as ready for review July 22, 2026 01:22
@eazyhozy
eazyhozy requested a review from em3s as a code owner July 22, 2026 01:22
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jul 22, 2026
@eazyhozy

Copy link
Copy Markdown
Member Author

This PR adds serializable date bucket metadata to codec-java so that it can be e2e-tested via internal bulkload pipeline. This should land before #397.

Could you review this PR? @em3s @zipdoki

@eazyhozy
eazyhozy requested a review from zipdoki July 22, 2026 01:29
Keep the nullable bucket out of the Jackson creator so metadata from
earlier releases and explicit null values remain deserializable when
strict creator null checks are enabled.

Tested: :codec-java:test (LabelDTOTests)
Tested: :codec-java:spotlessCheck

🤖 Generated with Codex (gpt-5.6-sol)

Co-Authored-By: Codex <[email protected]>
@zipdoki

zipdoki commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@eazyhozy
Could you run an actual bulkload with this branch to confirm it works end-to-end before merging?

@eazyhozy

Copy link
Copy Markdown
Member Author

@zipdoki Sure. I published codec-java from this branch and rebuilt the downstream Spark bulk-load jobs against it. I am replaying an actual bulk load through the metadata-creation stage. I will report whether the replay completes through that stage and whether the newly created table preserves the existing schema, especially its groups and date-bucket metadata (name, unit, timezone, and format). I will also run a historical AGG query; an empty result is expected at this point because EdgeGroup bulk-load encoding is introduced separately in #397.

@eazyhozy

Copy link
Copy Markdown
Member Author

@zipdoki Validation completed successfully:

  • Replayed a downstream Spark bulk load through table creation using codec-java built from this branch.
  • The newly created table schema matches the existing table schema exactly.
  • All groups were preserved, and every date bucket retained its type, name, unit, timezone, and format metadata.
  • Raw edge data was loaded and directly queryable.
  • A historical AGG query returned an empty result as expected because EdgeGroup bulk-load encoding is introduced separately in Encode EdgeGroup records in the bulk-load path (BulkEdgeEncoder) #397.

This confirms that LabelDTO can be serialized and deserialized through the downstream bulk-load flow without losing group or date-bucket metadata.

@zipdoki

zipdoki commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Optimistic Merge

@zipdoki
zipdoki merged commit 0bd0bfa into main Jul 23, 2026
2 checks passed
@zipdoki
zipdoki deleted the fix/codec-java-serializable-metadata branch July 23, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants