Hi Flink CDC developers,

I'm using Flink CDC 3.7.0 with Flink 1.20 to synchronize PostgreSQL/PostGIS 
tables into Apache Paimon.

I noticed a potential data fidelity issue when synchronizing complex PostGIS 
GEOMETRY values, especially MultiLineString, Polygon, and MultiPolygon.

The PostgreSQL Pipeline Connector appears to use Geometry.getCoordinates() to 
serialize geometry values. This method flattens the coordinates and does not 
preserve nested geometry component boundaries.

For example, consider:
MULTILINESTRING((0 0,1 1),(10 10,11 11))
Based on the current serialization implementation, the output appears to lose 
the boundaries between the two LineStrings.

I also observed output in my environment similar to:
{   "type": "MultiLineString",   "coordinates": 
"[[120.455451,30.838109],[120.457191,30.838922],...]",   "srid": 0 }
I noticed that PR #4086 changed the previous WKB-based representation to 
coordinate-based JSON:

https://github.com/apache/flink-cdc/pull/4086

I would like to ask:


Is flattening the geometry coordinates intentional, or is this an unintended 
regression?



Is there an existing configuration to preserve original WKB/EWKB and SRID?



Would the community consider supporting a lossless geometry serialization 
option?


My use case is synchronizing over 200 PostgreSQL tables into a Paimon ODS 
layer, including numerous PostGIS geometry columns. Preserving the original 
geometry structure is important for downstream spatial processing.

If this is considered a bug, I would be happy to file a Jira issue with a 
minimal reproducible example.

Thank you for your time and guidance!

Best regards

Reply via email to