Skip to content

Commit

Permalink
[bug fix] Fixed errors when convert clickhouse UUID to flink VARCHAR
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyfee authored and itinycheng committed Mar 19, 2023
1 parent 21c7aab commit 7c02a59
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.sql.Timestamp;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.UUID;

import static org.apache.flink.connector.clickhouse.internal.converter.ClickHouseConverterUtils.BOOL_TRUE;
import static org.apache.flink.connector.clickhouse.util.ClickHouseUtil.toEpochDayOneTimestamp;
Expand Down Expand Up @@ -117,7 +118,10 @@ protected ClickHouseRowConverter.DeserializationConverter createToInternalConver
return val -> TimestampData.fromInstant(((Timestamp) val).toInstant());
case CHAR:
case VARCHAR:
return val -> StringData.fromString((String) val);
return val ->
val instanceof UUID
? StringData.fromString(val.toString())
: StringData.fromString((String) val);
case ARRAY:
case MAP:
return val -> ClickHouseConverterUtils.toInternal(val, type);
Expand Down

0 comments on commit 7c02a59

Please sign in to comment.