Quanlong Huang created IMPALA-14647:
---------------------------------------
Summary: Truncate transactional table always delete data files for
replicated tables
Key: IMPALA-14647
URL: https://issues.apache.org/jira/browse/IMPALA-14647
Project: IMPALA
Issue Type: Bug
Components: Catalog
Reporter: Quanlong Huang
Assignee: Quanlong Huang
Hive has a configuration, hive.acid.truncate.usebase, in hive-site.xml of
HiveServer2 to control whether to delete the data files in TRUNCATE for
transactional tables.
{code:java}
HIVE_ACID_TRUNCATE_USE_BASE("hive.acid.truncate.usebase", true,
"If enabled, truncate for transactional tables will not delete the data
directories,\n" +
"rather create a new base directory with no datafiles."),{code}
[https://github.com/apache/hive/blob/e3cb93958ee470b261f44f99fc49716071f05b58/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java#L3138-L3140]
Currently, when the table is under Hive replication, Impala uses the
truncateTable HMS API without passing the deleteData parameter:
[https://github.com/apache/impala/blob/1970cc709df637f1e416198fb9a6553b2947bffa/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java#L3560-L3561]
[https://github.com/apache/impala/blob/1970cc709df637f1e416198fb9a6553b2947bffa/fe/src/compat-hive-3/java/org/apache/impala/compat/MetastoreShim.java#L728]
This results in deleteData=true:
[https://github.com/apache/hive/blob/e3cb93958ee470b261f44f99fc49716071f05b58/standalone-metastore/metastore-client/src/main/java/org/apache/hadoop/hive/metastore/client/BaseMetaStoreClient.java#L170]
Impala should set the deleteData parameter based on
"hive.acid.truncate.usebase".
--
This message was sent by Atlassian Jira
(v8.20.10#820010)