Skip to content

Fix missing type casting in AGG group qualifier encoding#235

Open
zipdoki wants to merge 1 commit intomainfrom
feat/group-field-type-casting
Open

Fix missing type casting in AGG group qualifier encoding#235
zipdoki wants to merge 1 commit intomainfrom
feat/group-field-type-casting

Conversation

@zipdoki
Copy link
Copy Markdown
Contributor

@zipdoki zipdoki commented Mar 31, 2026

Summary

Cast AGG predicate values using schema field types resolved at entity construction.

Closes #227

What changed

  • Group.Field gains a type: PrimitiveType? field. bucketOrGet() uses it to cast when no bucket is present.
  • LabelEntity factory methods resolve DataTypePrimitiveType from the schema. Resolution always runs to avoid stale values.
  • DECIMAL fields throw an explicit error (not yet supported in PrimitiveType).
  • Added unit tests for bucketOrGet() branching and an E2E test covering bucket-only, String+bucket, and Long+bucket group configurations.

How to test

# Unit tests — bucketOrGet() branching logic
./gradlew :core:test --tests "com.kakao.actionbase.core.metadata.common.GroupFieldTest"

# E2E tests — full AGG query flow (mutation → query) for 3 group types
./gradlew :server:test --tests "com.kakao.actionbase.server.api.graph.v3.EdgeAggQueryE2ETest"

# Full build
./gradlew build

Predicate values are parsed as String, causing qualifier encoding mismatch. Add PrimitiveType to Group.Field to cast values ?from schema.
@zipdoki zipdoki requested a review from em3s March 31, 2026 04:16
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Mar 31, 2026
DataType.DOUBLE -> PrimitiveType.DOUBLE
DataType.STRING -> PrimitiveType.STRING
DataType.JSON -> PrimitiveType.OBJECT
DataType.DECIMAL -> error("DECIMAL is not supported as a group field type. Use a supported type instead.")
Copy link
Copy Markdown
Contributor Author

@zipdoki zipdoki Mar 31, 2026

Choose a reason for hiding this comment

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

@em3s
DECIMAL group fields are not yet supported — PrimitiveType has no DECIMAL variant. Tracked for a follow-up.

@em3s
Copy link
Copy Markdown
Contributor

em3s commented Apr 1, 2026

Left a comment on #227.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing type casting in AGG group qualifier encoding

2 participants