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



##########
File path: 
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/catalog/PostgresCatalogITCase.java
##########
@@ -139,4 +139,19 @@ public void testArrayTypes() {
                                "[00:51:03, 00:59:03]]",
                        results.toString());
        }
+
+       @Test
+       public void testSerialTypes() {
+               List<Row> results = Lists.newArrayList(
+                       tEnv.sqlQuery(String.format("select * from %s", 
TABLE_SERIAL_TYPE)).execute().collect());
+
+               assertEquals("[" +
+                               "2767," +

Review comment:
       ```suggestion
                                "32767," +
   ```

##########
File path: 
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/catalog/PostgresCatalogTestBase.java
##########
@@ -289,4 +292,30 @@ public static TestTable getArrayTable() {
                        ));
        }
 
+       public static TestTable getSerialTable() {
+               return new TestTable(
+                       TableSchema.builder()
+                               // serial fields are returned as not null by 
ResultSetMetaData.columnNoNulls
+                               .field("f0", DataTypes.SMALLINT().notNull())
+                               .field("f1", DataTypes.INT().notNull())
+                               .field("f2", DataTypes.SMALLINT().notNull())
+                               .field("f3", DataTypes.INT().notNull())
+                               .field("f4", DataTypes.BIGINT().notNull())
+                               .field("f5", DataTypes.BIGINT().notNull())
+                               .build(),
+                       "f0 smallserial, " +
+                               "f1 serial, " +
+                               "f2 serial2, " +
+                               "f3 serial4, " +
+                               "f4 serial8, " +
+                               "f5 bigserial",
+                       "2767," +

Review comment:
       ```suggestion
                        "32767," +
   ```

##########
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:
       It's fine to me, we only read serial from PG and wont write a serial 
column. 




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