[
https://issues.apache.org/jira/browse/HIVE-26414?focusedWorklogId=796793&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-796793
]
ASF GitHub Bot logged work on HIVE-26414:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Aug/22 07:17
Start Date: 01/Aug/22 07:17
Worklog Time Spent: 10m
Work Description: SourabhBadhya commented on code in PR #3457:
URL: https://github.com/apache/hive/pull/3457#discussion_r933135808
##########
ql/src/java/org/apache/hadoop/hive/ql/HookRunner.java:
##########
@@ -56,6 +57,7 @@ public class HookRunner {
HookRunner(HiveConf conf, SessionState.LogHelper console) {
this.conf = conf;
this.hooks = new HiveHooks(conf, console);
+ addNecessaryHooks();
Review Comment:
`addNecessaryHooks()` will have all the hooks that are absolutely required
from now on. Thought this would be a good way to go about. But let me know if
this function is required so that I can change it.
##########
ql/src/java/org/apache/hadoop/hive/ql/HookRunner.java:
##########
@@ -56,6 +57,7 @@ public class HookRunner {
HookRunner(HiveConf conf, SessionState.LogHelper console) {
this.conf = conf;
this.hooks = new HiveHooks(conf, console);
+ addNecessaryHooks();
Review Comment:
Done
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/create/CtasQueryLifeTimeHook.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql.ddl.table.create;
+
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.metastore.api.CompactionRequest;
+import org.apache.hadoop.hive.metastore.api.CompactionType;
+import org.apache.hadoop.hive.metastore.api.MetaException;
+import org.apache.hadoop.hive.metastore.txn.TxnStore;
+import org.apache.hadoop.hive.metastore.txn.TxnUtils;
+import org.apache.hadoop.hive.ql.Context;
+import org.apache.hadoop.hive.ql.hooks.PrivateHookContext;
+import org.apache.hadoop.hive.ql.hooks.QueryLifeTimeHook;
+import org.apache.hadoop.hive.ql.hooks.QueryLifeTimeHookContext;
+import org.apache.hadoop.hive.ql.metadata.Table;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
+
+import static
org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.IF_PURGE;
+import static
org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.META_TABLE_LOCATION;
+
+public class CtasQueryLifeTimeHook implements QueryLifeTimeHook {
Review Comment:
Done
Issue Time Tracking
-------------------
Worklog Id: (was: 796793)
Time Spent: 8h (was: 7h 50m)
> Aborted/Cancelled CTAS operations must initiate cleanup of uncommitted data
> ---------------------------------------------------------------------------
>
> Key: HIVE-26414
> URL: https://issues.apache.org/jira/browse/HIVE-26414
> Project: Hive
> Issue Type: Improvement
> Reporter: Sourabh Badhya
> Assignee: Sourabh Badhya
> Priority: Major
> Labels: pull-request-available
> Time Spent: 8h
> Remaining Estimate: 0h
>
> When a CTAS query fails before creation of table and after writing the data,
> the data is present in the directory and not cleaned up currently by the
> cleaner or any other mechanism currently. This is because the cleaner
> requires a table corresponding to what its cleaning. In order surpass such a
> situation, we can directly pass the relevant information to the cleaner so
> that such uncommitted data is deleted.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)