JingsongLi commented on code in PR #1213:
URL: https://github.com/apache/incubator-paimon/pull/1213#discussion_r1202378367
##########
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:
Don't just return this.
For example, Hive DDL can be f1, f2, but table can be f0,f1,f2,f3,f4
--
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]