JingsongLi commented on code in PR #292:
URL: https://github.com/apache/flink-table-store/pull/292#discussion_r969376212


##########
flink-table-store-format/src/main/java/org/apache/flink/table/store/format/orc/OrcFileFormat.java:
##########
@@ -108,4 +113,71 @@ private static Properties getOrcProperties(ReadableConfig 
options) {
         properties.forEach((k, v) -> orcProperties.put(IDENTIFIER + "." + k, 
v));
         return orcProperties;
     }
+
+    /** See {@code org.apache.flink.table.catalog.hive.util.HiveTypeUtil}. */
+    public static TypeDescription logicalTypeToOrcType(LogicalType type) {
+        type = type.copy(true);
+        switch (type.getTypeRoot()) {
+            case CHAR:
+                return TypeDescription.createChar().withMaxLength(((CharType) 
type).getLength());
+            case VARCHAR:
+                int len = ((VarCharType) type).getLength();
+                if (len == VarCharType.MAX_LENGTH) {
+                    return TypeDescription.createString();
+                } else {
+                    return TypeDescription.createVarchar().withMaxLength(len);
+                }
+            case BOOLEAN:
+                return TypeDescription.createBoolean();
+            case BINARY:
+                return TypeDescription.createBinary();
+            case VARBINARY:
+                if (type.equals(DataTypes.BYTES().getLogicalType())) {
+                    return TypeDescription.createBinary();
+                } else {
+                    throw new UnsupportedOperationException(

Review Comment:
   We can support this too



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

Reply via email to