You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "lh0156 (via GitHub)" <gi...@apache.org> on 2026/08/03 02:39:54 UTC
[PR] KAFKA-16870: Avoid schemaless containers from Values.parseString [kafka]
lh0156 opened a new pull request, #23055:
URL: https://github.com/apache/kafka/pull/23055
## What
`Values.parseString` no longer returns arrays or maps with missing inner schemas when it cannot infer a common schema. Instead, it falls back to the original literal as a `STRING` value. This also makes `SimpleHeaderConverter` safe for empty and heterogeneous containers because it relies on `Values.parseString`.
## Why
Connect arrays and maps require inner schemas for validation. Returning a container with a null inner schema creates a `SchemaAndValue` that fails later in `ConnectSchema.validateValue`, for example when used as a struct field value. Falling back to the original string preserves the input without manufacturing an invalid Connect value.
## Testing
- Added RED tests for heterogeneous arrays, nested containers, heterogeneous map values, and header conversion.
- Added a regression test that validates the returned `SchemaAndValue` with `ConnectSchema.validateValue`.
- `./gradlew :connect:api:test :connect:api:spotlessCheck :connect:api:checkstyleMain :connect:api:checkstyleTest :connect:api:spotbugsMain --no-build-cache --console=plain`
- `./gradlew :connect:transforms:test :connect:api:spotlessCheck :connect:api:checkstyleMain :connect:api:checkstyleTest :connect:api:spotbugsMain --no-build-cache --console=plain`
JIRA: https://issues.apache.org/jira/browse/KAFKA-16870
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-16870: Avoid schemaless containers from Values.parseString [kafka]
Posted by "lh0156 (via GitHub)" <gi...@apache.org>.
lh0156 commented on PR #23055:
URL: https://github.com/apache/kafka/pull/23055#issuecomment-5165921081
Follow-up test-only refinement in `3be96c31fb`: added a map-specific `ConnectSchema.validateValue` regression assertion alongside the existing array assertion. This makes the Jira failure mode explicit for both missing map key/value schemas and keeps the test contract readable.
Verification:
- `./gradlew :connect:api:test --tests org.apache.kafka.connect.data.ValuesTest.shouldReturnSchemaAndValueAcceptedByConnectSchemaForIncompatibleMap --tests org.apache.kafka.connect.data.ValuesTest.shouldReturnSchemaAndValueAcceptedByConnectSchemaForIncompatibleArray :connect:api:spotlessCheck :connect:api:checkstyleMain :connect:api:checkstyleTest :connect:api:spotbugsMain --no-build-cache --console=plain`
- Result: `BUILD SUCCESSFUL`
- Full `:connect:api:test` and `:connect:transforms:test` also passed after the refinement.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-16870: Avoid schemaless containers from Values.parseString [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23055:
URL: https://github.com/apache/kafka/pull/23055#issuecomment-5235599838
A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the `triage` label
should be removed to prevent this automation from happening again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org