RocMarshal commented on code in PR #182:
URL:
https://github.com/apache/flink-connector-jdbc/pull/182#discussion_r2597200315
##########
flink-connector-jdbc-core/src/main/java/org/apache/flink/connector/jdbc/core/database/dialect/AbstractDialectConverter.java:
##########
@@ -173,7 +173,7 @@ protected JdbcDeserializationConverter
createInternalConverter(LogicalType type)
: TimestampData.fromTimestamp((Timestamp) val);
case CHAR:
case VARCHAR:
- return val -> StringData.fromString((String) val);
+ return val -> StringData.fromString(val == null ? null:
val.toString());
Review Comment:
```suggestion
return val -> StringData.fromString(val == null ? null :
val.toString());
```
##########
flink-connector-jdbc-postgres/src/test/java/org/apache/flink/connector/jdbc/postgres/database/catalog/PostgresCatalogITCase.java:
##########
@@ -193,4 +193,28 @@ void testSerialTypes() {
+ "9223372036854775807, "
+ "9223372036854775807]]");
}
+
+ @Test
+ void testUuidTypes() {
+ List<Row> results =
+ CollectionUtil.iteratorToList(
+ tEnv.sqlQuery(String.format("select * from %s",
TABLE_UUID_TYPE))
+ .execute()
+ .collect());
+ assertThat(results)
+ .hasToString(
+ "[+I[1, 123e4567-e89b-12d3-a456-426614174000]]");
+ }
+
+ @Test
+ void testNullUuidTypes() {
+ List<Row> results =
+ CollectionUtil.iteratorToList(
+ tEnv.sqlQuery(String.format("select * from %s",
TABLE_UUID_TYPE2))
+ .execute()
+ .collect());
+ assertThat(results)
+ .hasToString(
+ "[+I[1, NULL]]");
Review Comment:
```suggestion
"[+I[1, null]]");
```
##########
flink-connector-jdbc-postgres/src/main/java/org/apache/flink/connector/jdbc/postgres/database/dialect/PostgresDialectConverter.java:
##########
@@ -28,7 +28,6 @@
import org.apache.flink.table.types.logical.utils.LogicalTypeUtils;
import java.lang.reflect.Array;
Review Comment:
```suggestion
import java.lang.reflect.Array;
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]