This is an automated email from the ASF dual-hosted git repository.
tchoi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new e49fe08b157 HIVE-27669: Hive Acid CTAS fails incremental if no of rows
inserted is > INT_MAX (#4665) (Harshal Patel, reviewed by Teddy Choi)
e49fe08b157 is described below
commit e49fe08b1579cf03d4bb69455535d688fa5bd667
Author: harshal-16 <[email protected]>
AuthorDate: Mon Sep 11 12:27:34 2023 +0530
HIVE-27669: Hive Acid CTAS fails incremental if no of rows inserted is >
INT_MAX (#4665) (Harshal Patel, reviewed by Teddy Choi)
---
ql/src/java/org/apache/hadoop/hive/ql/ddl/DDLTask.java | 4 ++++
.../org/apache/hadoop/hive/ql/exec/repl/util/ReplUtils.java | 10 ++++++++++
2 files changed, 14 insertions(+)
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/ddl/DDLTask.java
b/ql/src/java/org/apache/hadoop/hive/ql/ddl/DDLTask.java
index 11b7af6e1de..73966a28f5c 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/ddl/DDLTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/ddl/DDLTask.java
@@ -86,6 +86,10 @@ public final class DDLTask extends Task<DDLWork> implements
Serializable {
throw new IllegalArgumentException("Unknown DDL request: " +
ddlDesc.getClass());
}
} catch (Throwable e) {
+ if(work.isReplication() && ReplUtils.shouldIgnoreOnError(ddlOperation,
e)) {
+ LOG.warn("Error while table creation: ", e);
+ return 0;
+ }
failed(e);
if(ddlOperation != null) {
LOG.error("DDLTask failed, DDL Operation: " +
ddlOperation.getClass().toString(), e);
diff --git
a/ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/ReplUtils.java
b/ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/ReplUtils.java
index abc3e6627c9..61516a8604d 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/ReplUtils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/ReplUtils.java
@@ -45,6 +45,8 @@ import
org.apache.hadoop.hive.metastore.messaging.MessageFactory;
import org.apache.hadoop.hive.metastore.utils.StringUtils;
import org.apache.hadoop.hive.ql.ErrorMsg;
import org.apache.hadoop.hive.ql.ddl.DDLWork;
+import org.apache.hadoop.hive.ql.ddl.DDLOperation;
+import org.apache.hadoop.hive.ql.ddl.table.create.CreateTableOperation;
import
org.apache.hadoop.hive.ql.ddl.table.misc.properties.AlterTableSetPropertiesDesc;
import org.apache.hadoop.hive.ql.ddl.table.partition.PartitionUtils;
import org.apache.hadoop.hive.ql.exec.Task;
@@ -351,6 +353,14 @@ public class ReplUtils {
return errorCode;
}
+ public static boolean shouldIgnoreOnError(DDLOperation<?> ddlOperation,
Throwable e) {
+ return ReplUtils.isCreateOperation(ddlOperation) &&
e.getMessage().contains("java.lang.NumberFormatException");
+ }
+
+ public static boolean isCreateOperation(DDLOperation<?> ddlOperation) {
+ return ddlOperation instanceof CreateTableOperation;
+ }
+
private static String getMetricStageName(String stageName,
ReplicationMetricCollector metricCollector) {
if( stageName == "REPL_DUMP" || stageName == "REPL_LOAD" || stageName ==
"ATLAS_DUMP" || stageName == "ATLAS_LOAD"
|| stageName == "RANGER_DUMP" || stageName == "RANGER_LOAD" ||
stageName == "RANGER_DENY"){