You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tw...@apache.org on 2019/08/05 08:58:34 UTC

[flink] 04/04: [FLINK-13463][table-common] Relax legacy type info conversion for VARCHAR literals

This is an automated email from the ASF dual-hosted git repository.

twalthr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 80e81c7e34b48e1e0d8cf4f2e282307744c0dc2f
Author: Timo Walther <tw...@apache.org>
AuthorDate: Thu Aug 1 16:44:57 2019 +0200

    [FLINK-13463][table-common] Relax legacy type info conversion for VARCHAR literals
    
    This closes #9334.
---
 .../flink/table/types/utils/LegacyTypeInfoDataTypeConverter.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/LegacyTypeInfoDataTypeConverter.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/LegacyTypeInfoDataTypeConverter.java
index 2990a67..20b6db8 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/LegacyTypeInfoDataTypeConverter.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/LegacyTypeInfoDataTypeConverter.java
@@ -197,7 +197,7 @@ public final class LegacyTypeInfoDataTypeConverter {
 			return foundTypeInfo;
 		}
 
-		// we are relaxing the constraint for DECIMAL, CHAR, TIMESTAMP_WITHOUT_TIME_ZONE to
+		// we are relaxing the constraint for DECIMAL, CHAR, VARCHAR, TIMESTAMP_WITHOUT_TIME_ZONE to
 		// support value literals in legacy planner
 		LogicalType logicalType = dataType.getLogicalType();
 		if (hasRoot(logicalType, LogicalTypeRoot.DECIMAL)) {
@@ -208,6 +208,10 @@ public final class LegacyTypeInfoDataTypeConverter {
 			return Types.STRING;
 		}
 
+		else if (hasRoot(logicalType, LogicalTypeRoot.VARCHAR)) {
+			return Types.STRING;
+		}
+
 		else if (canConvertToTimestampTypeInfoLenient(dataType)) {
 			return Types.SQL_TIMESTAMP;
 		}