leonardBang commented on a change in pull request #11900:
URL: https://github.com/apache/flink/pull/11900#discussion_r429647116



##########
File path: 
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/catalog/PostgresCatalog.java
##########
@@ -231,13 +231,19 @@ public CatalogBaseTable getTable(ObjectPath tablePath) 
throws TableNotExistExcep
        }
 
        // Postgres jdbc driver maps several alias to real type, we use real 
type rather than alias:
+       // serial2 <=> int2
+       // serial4 <=> serial
+       // serial8 <=> bigserial
+       // smallserial <=> int2

Review comment:
       ```suggestion
        // serial2 <=> int2
        // smallserial <=> int2
        // serial4 <=> serial
        // serial8 <=> bigserial
   ```
   How about bubbling up "// smallserial <=> int2 " to make them look better?

##########
File path: 
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/catalog/PostgresCatalogTestBase.java
##########
@@ -289,4 +292,29 @@ public static TestTable getArrayTable() {
                        ));
        }
 
+       public static TestTable getSerialTable() {
+               return new TestTable(
+                       TableSchema.builder()
+                               .field("f0", DataTypes.SMALLINT())
+                               .field("f1", DataTypes.INT())
+                               .field("f2", DataTypes.SMALLINT())
+                               .field("f3", DataTypes.INT())
+                               .field("f4", DataTypes.BIGINT())
+                               .field("f5", DataTypes.BIGINT())
+                               .build(),
+                       "f0 smallserial, " +
+                               "f1 serial, " +
+                               "f2 serial2, " +
+                               "f3 serial4, " +
+                               "f4 serial8, " +
+                               "f5 bigserial",
+                       "0," +
+                               "1," +
+                               "2," +
+                               "3," +
+                               "4," +
+                               "5"

Review comment:
       This values is never used.
   How about add a ITCase that read serial type data properly to check the 
convert logic? and we can use more meaningful values like "32767, 2147483647, 
32767, 2147483647 , 9223372036854775807, 9223372036854775807" .




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to