yuzelin commented on code in PR #1213:
URL: https://github.com/apache/incubator-paimon/pull/1213#discussion_r1203344135


##########
paimon-hive/paimon-hive-connector-common/src/main/java/org/apache/paimon/hive/HiveSchema.java:
##########
@@ -112,21 +111,24 @@ public static HiveSchema extract(@Nullable Configuration 
configuration, Properti
         List<String> columnNames = 
Arrays.asList(columnProperty.split(columnNameDelimiter));
         String columnTypes = 
properties.getProperty(serdeConstants.LIST_COLUMN_TYPES);
         List<TypeInfo> typeInfos = 
TypeInfoUtils.getTypeInfosFromTypeString(columnTypes);
+
+        // If both Paimon table schema and Hive table schema exist, we check 
whether the schema
+        // matches and still build from Paimon table schema
+        if (tableSchema.isPresent()) {
+            if (columnNames.size() > 0 && typeInfos.size() > 0) {
+                LOG.debug(
+                        "Extract schema with exists DDL and exists paimon 
table, table location:[{}].",
+                        location);
+                checkSchemaMatched(columnNames, typeInfos, tableSchema.get());
+            }
+
+            return new HiveSchema(new RowType(tableSchema.get().fields()));

Review Comment:
   modified.



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