Skip to content

Commit e731d67

Browse files
committed
update
1 parent 4271144 commit e731d67

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-postgres/src/main/java/org/apache/flink/cdc/connectors/postgres/utils/PostgresTypeUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ private static DataType convertFromColumn(
159159
case PgOid.DATERANGE_OID:
160160
return DataTypes.STRING();
161161
case PgOid.TEXT_ARRAY:
162+
case PgOid.UUID_ARRAY:
162163
return DataTypes.ARRAY(DataTypes.STRING());
163164
case PgOid.TIMESTAMP:
164165
return handleTimestampWithTemporalMode(temporalPrecisionMode, scale);

flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-postgres/src/test/java/org/apache/flink/cdc/connectors/postgres/source/PostgresFullTypesITCase.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,12 @@ public void testArrayTypes() throws Exception {
873873

874874
ArrayData actualIntArray = (ArrayData) actualSnapshotObjects[3];
875875
Assertions.assertThat(actualIntArray.getInt(0)).isEqualTo(42);
876+
877+
ArrayData actualUuidArray = (ArrayData) actualSnapshotObjects[4];
878+
Assertions.assertThat(actualUuidArray.getString(0))
879+
.isEqualTo(BinaryStringData.fromString("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"));
880+
Assertions.assertThat(actualUuidArray.getString(1))
881+
.isEqualTo(BinaryStringData.fromString("b0eebc99-9c0b-4ef8-bb6d-6bb9bd380a22"));
876882
}
877883

878884
@Test
@@ -1117,7 +1123,8 @@ private Instant toInstant(String ts) {
11171123
DataTypes.INT(),
11181124
DataTypes.ARRAY(DataTypes.STRING()),
11191125
DataTypes.ARRAY(DataTypes.INT()),
1120-
DataTypes.ARRAY(DataTypes.INT()));
1126+
DataTypes.ARRAY(DataTypes.INT()),
1127+
DataTypes.ARRAY(DataTypes.STRING()));
11211128

11221129
private static final RowType ARRAY_TYPES_WITH_NULL =
11231130
RowType.of(

flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-postgres/src/test/resources/ddl/column_type_test.sql

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,20 @@ CREATE TABLE array_types (
159159
id SERIAL PRIMARY KEY,
160160
text_a1 TEXT[],
161161
int_a1 INTEGER[],
162-
int_s1 INTEGER[]
162+
int_s1 INTEGER[],
163+
uuid_a1 UUID[]
163164
);
164165

165166
ALTER TABLE inventory.array_types
166167
REPLICA IDENTITY FULL;
167168

168-
INSERT INTO array_types (id,text_a1, int_a1, int_s1)
169+
INSERT INTO array_types (id,text_a1, int_a1, int_s1, uuid_a1)
169170
VALUES
170171
(1,
171172
ARRAY['electronics', 'gadget', 'sale'],
172173
'{85, 90, 78}',
173-
'{42}'
174+
'{42}',
175+
ARRAY['a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', 'b0eebc99-9c0b-4ef8-bb6d-6bb9bd380a22']::UUID[]
174176
);
175177

176178
CREATE TABLE array_types_with_null (

0 commit comments

Comments
 (0)