[cdc] Fix PostgresTypeUtils to map out-of-range numeric precision to STRING#8610
Open
thswlsqls wants to merge 1 commit into
Open
[cdc] Fix PostgresTypeUtils to map out-of-range numeric precision to STRING#8610thswlsqls wants to merge 1 commit into
thswlsqls wants to merge 1 commit into
Conversation
…STRING Postgres numeric allows precision up to 1000, but Paimon DecimalType.MAX_PRECISION is 38, so numeric(50,2) made schema derivation throw IllegalArgumentException. Fall back to STRING (ARRAY(STRING) for _numeric) when precision exceeds 38, mirroring the sibling MySqlTypeUtils guard. Precision 0 default and the 1..38 behavior are preserved. Generated-by: Claude Code
Contributor
|
Currently, only |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
fix #8605
numericallows precision up to 1000, but PaimonDecimalType.MAX_PRECISIONis 38, soPostgresTypeUtils.toDataType()threwIllegalArgumentExceptionon anumeric(50,2)column and schema derivation failed before the CDC sink could start.STRING(ARRAY(STRING)for_numeric); precision 0 default (DECIMAL(38,18)) and the 1..38 behavior are preserved.MySqlTypeUtils.toDataType()guard (length <= 38 ? DECIMAL : STRING) under the sameJdbcToPaimonTypeVisitorSPI.Tests
PostgresTypeUtilsTestcovering precision 50 → STRING, 10/38 → DECIMAL, 0 → DECIMAL(38,18), and_numericarray symmetry.mvn -pl paimon-flink/paimon-flink-cdc -am -Pflink1 clean install— 4 tests passed (checkstyle/spotless/rat green).