You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by yu...@apache.org on 2025/05/08 02:20:05 UTC
(paimon) branch master updated: [Bug] Fix that Hive DDL and paimon schema mismatched excetion when show the table's schema with the timestamp type (#5501)
This is an automated email from the ASF dual-hosted git repository.
yuzelin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new ca2b76c123 [Bug] Fix that Hive DDL and paimon schema mismatched excetion when show the table's schema with the timestamp type (#5501)
ca2b76c123 is described below
commit ca2b76c1234f5e34e79d38873b4d1e0e115f1c5c
Author: Jack1007 <ya...@gmail.com>
AuthorDate: Thu May 8 10:19:59 2025 +0800
[Bug] Fix that Hive DDL and paimon schema mismatched excetion when show the table's schema with the timestamp type (#5501)
---
.../src/main/java/org/apache/paimon/hive/HiveSchema.java | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/paimon-hive/paimon-hive-connector-common/src/main/java/org/apache/paimon/hive/HiveSchema.java b/paimon-hive/paimon-hive-connector-common/src/main/java/org/apache/paimon/hive/HiveSchema.java
index 108315a961..cf6cbd49d1 100644
--- a/paimon-hive/paimon-hive-connector-common/src/main/java/org/apache/paimon/hive/HiveSchema.java
+++ b/paimon-hive/paimon-hive-connector-common/src/main/java/org/apache/paimon/hive/HiveSchema.java
@@ -255,6 +255,17 @@ public class HiveSchema {
for (int i = 0; i < hiveFieldNames.size(); i++) {
if (!hiveFieldNames.get(i).equalsIgnoreCase(schemaFieldNames.get(i))
|| !Objects.equals(hiveFieldTypeInfos.get(i), schemaFieldTypeInfos.get(i))) {
+ if (hiveFieldNames.get(i).equalsIgnoreCase(schemaFieldNames.get(i))
+ && hiveFieldTypeInfos.get(i).getTypeName().equals("timestamp")
+ && schemaFieldTypeInfos
+ .get(i)
+ .getTypeName()
+ .equals("timestamp with local time zone")) {
+ // Hive timestamp is compatible with paimon timestamp with local time zone
+ LOG.warn(
+ "Hive DDL and paimon schema mismatched, but Hive timestamp is compatible with paimon timestamp with local time zone");
+ continue;
+ }
String ddlField =
hiveFieldNames.get(i) + " " + hiveFieldTypeInfos.get(i).getTypeName();
String schemaField =