Skip to content

Commit

Permalink
HIVE-27850: Iceberg: Addendum: Use fully qualified table name in comp…
Browse files Browse the repository at this point in the history
…action query (Dmitriy Fingerman, reviewed by Denys Kuzmenko)

Closes #5074
  • Loading branch information
difin committed Feb 9, 2024
1 parent 40b3bb4 commit 32a7927
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.hadoop.hive.ql.session.SessionState;
import org.apache.hadoop.hive.ql.txn.compactor.CompactorContext;
import org.apache.hadoop.hive.ql.txn.compactor.QueryCompactor;
import org.apache.hive.iceberg.org.apache.orc.storage.common.TableName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -39,12 +40,12 @@ public class IcebergMajorQueryCompactor extends QueryCompactor {
@Override
public boolean run(CompactorContext context) throws IOException, HiveException, InterruptedException {

String compactTableName = context.getTable().getTableName();
String compactTableName = TableName.getDbTable(context.getTable().getDbName(), context.getTable().getTableName());
Map<String, String> tblProperties = context.getTable().getParameters();
LOG.debug("Initiating compaction for the {} table", compactTableName);

String compactionQuery = String.format("insert overwrite table %s select * from %s",
compactTableName, compactTableName);
String compactionQuery = String.format("insert overwrite table %s select * from %<s",
compactTableName);

SessionState sessionState = setupQueryCompactionSession(context.getConf(),
context.getCompactionInfo(), tblProperties);
Expand Down

0 comments on commit 32a7927

Please sign in to comment.