Skip to content

Commit db8847d

Browse files
committed
fix the timestamp type validation issue-5450
1 parent 30a7495 commit db8847d

File tree

1 file changed

+10
-0
lines changed
  • paimon-hive/paimon-hive-connector-common/src/main/java/org/apache/paimon/hive

1 file changed

+10
-0
lines changed

paimon-hive/paimon-hive-connector-common/src/main/java/org/apache/paimon/hive/HiveSchema.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,16 @@ private static void checkFieldsMatched(
255255
for (int i = 0; i < hiveFieldNames.size(); i++) {
256256
if (!hiveFieldNames.get(i).equalsIgnoreCase(schemaFieldNames.get(i))
257257
|| !Objects.equals(hiveFieldTypeInfos.get(i), schemaFieldTypeInfos.get(i))) {
258+
if (schemaFieldTypeInfos
259+
.get(i)
260+
.getTypeName()
261+
.equals("timestamp with local time zone")) {
262+
// Hive timestamp is compatible with paimon timestamp
263+
// with local time zone
264+
LOG.info(
265+
"Hive DDL and paimon schema mismatched, but Hive timestamp is compatible with paimon timestamp with local time zone");
266+
continue;
267+
}
258268
String ddlField =
259269
hiveFieldNames.get(i) + " " + hiveFieldTypeInfos.get(i).getTypeName();
260270
String schemaField =

0 commit comments

Comments
 (0)