deniskuzZ commented on code in PR #3746:
URL: https://github.com/apache/hive/pull/3746#discussion_r1032330198
##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorFactory.java:
##########
@@ -48,39 +56,54 @@ private QueryCompactorFactory() {
* <br>
* {@link MmMinorQueryCompactor} - handles query based minor compaction for
micro-managed tables
* <br>
+ * {@link MRCompactor} - handles MR based minor, major, or rebalance
compaction
+ * <br>
+ * {@link RebalanceQueryCompactor} - handles query based rebalance compaction
+ * <br>
* </p>
+ * @param msc The {@link IMetaStoreClient} instance is used only by the
{@link MRCompactor}.
* @param table the table, on which the compaction should be running, must
be not null.
* @param configuration the hive configuration, must be not null.
* @param compactionInfo provides insight about the type of compaction, must
be not null.
* @return {@link QueryCompactor} or null.
*/
- static QueryCompactor getQueryCompactor(Table table, HiveConf configuration,
CompactionInfo compactionInfo)
+ public Compactor getQueryCompactor(IMetaStoreClient msc, Table table,
HiveConf configuration, CompactionInfo compactionInfo)
throws HiveException {
- if (!AcidUtils.isInsertOnlyTable(table.getParameters())
- && HiveConf.getBoolVar(configuration,
HiveConf.ConfVars.COMPACTOR_CRUD_QUERY_BASED)) {
- if (!"tez".equalsIgnoreCase(HiveConf.getVar(configuration,
HiveConf.ConfVars.HIVE_EXECUTION_ENGINE))) {
+ if (AcidUtils.isFullAcidTable(table.getParameters())) {
+ if (!"tez".equalsIgnoreCase(HiveConf.getVar(configuration,
HiveConf.ConfVars.HIVE_EXECUTION_ENGINE)) ||
+ !HiveConf.getBoolVar(configuration,
HiveConf.ConfVars.COMPACTOR_CRUD_QUERY_BASED)) {
+ if (CompactionType.REBALANCE.equals(compactionInfo.type)) {
+ throw new HiveException("Rebalancing compaction is only supported in
Tez, and via Query based compaction. " +
+ "Set hive.execution.engine=tez and
hive.compactor.crud.query.based=true to enable it.");
+ }
LOG.info("Query-based compaction is only supported on tez. Falling
back to MR compaction.");
Review Comment:
that's confusing, we only enter here when it's NOT Tez or **NOT**
QUERY_BASED. For MR compaction users would see below??
````
LOG.info("Query-based compaction is only supported on tez. Falling back to
MR compaction.");
???????
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]