You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/08/10 20:34:37 UTC

[GitHub] [hive] pkumarsinha commented on a change in pull request #1362: HIVE-23995 : Don't set location for managed tables in case of repl load

pkumarsinha commented on a change in pull request #1362:
URL: https://github.com/apache/hive/pull/1362#discussion_r468158289



##########
File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/BaseReplicationScenariosAcidTables.java
##########
@@ -98,6 +98,7 @@ static void internalBeforeClassSetup(Map<String, String> overrides, Class clazz)
       put("hive.metastore.disallow.incompatible.col.type.changes", "false");
       put("hive.in.repl.test", "true");
       put("metastore.warehouse.tenant.colocation", "true");
+      put(HiveConf.ConfVars.REPL_DATA_COPY_LAZY.varname, "false");

Review comment:
       We can set it in WarehouseInstance itself, it will act as a default for both the test repl base classes.
   Additionally in Test files which doesn't extends from BaseReplicationScenario*.java like you have in TestReplicationScenarios.java if any.

##########
File path: llap-common/src/test/org/apache/hadoop/hive/llap/AsyncResponseHandlerTest.java
##########
@@ -85,6 +86,7 @@ public void testRemoteFail() throws InterruptedException {
 
   }
 
+  @Ignore("HIVE-24019")

Review comment:
       This test has been fixed. We can revert this.

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/ddl/table/partition/rename/AlterTableRenamePartitionOperation.java
##########
@@ -75,13 +75,6 @@ public int execute() throws HiveException {
     part.setValues(desc.getNewPartSpec());
 
     long writeId = desc.getWriteId();
-    if (replicationSpec != null && replicationSpec.isMigratingToTxnTable()) {
-      Long tmpWriteId = ReplUtils.getMigrationCurrentTblWriteId(context.getConf());

Review comment:
       Also remove ReplUtils.getMigrationCurrentTblWriteId

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSpec.java
##########
@@ -404,20 +402,6 @@ public SCOPE getScope(){
     }
   }
 
-  public boolean isMigratingToTxnTable() {
-    return isMigratingToTxnTable;
-  }
-  public void setMigratingToTxnTable() {
-    isMigratingToTxnTable = true;
-  }
-
-  public boolean isMigratingToExternalTable() {

Review comment:
       Is migration to even external table also being removed? 

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/ReplUtils.java
##########
@@ -278,19 +240,10 @@ private static void addOpenTxnTaskForMigration(String actualDbName, String actua
                                                                               long writeId)
           throws IOException, TException {
     List<Task<?>> taskList = new ArrayList<>();
-    boolean isMigratingToTxn = ReplUtils.isTableMigratingToTransactional(conf, tableObj);
-    ColumnStatsUpdateWork work = new ColumnStatsUpdateWork(colStats, isMigratingToTxn);
+    ColumnStatsUpdateWork work = new ColumnStatsUpdateWork(colStats);

Review comment:
       Remove the  updatedMetadata, tableObj as they are unused

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/events/filesystem/FSTableEvent.java
##########
@@ -106,38 +106,6 @@ public MetaData getMetaData() {
   public ImportTableDesc tableDesc(String dbName) throws SemanticException {
     try {
       Table table = new Table(metadata.getTable());
-      boolean externalTableOnSource = TableType.EXTERNAL_TABLE.equals(table.getTableType());
-      // The table can be non acid in case of replication from 2.6 cluster.
-      if (!AcidUtils.isTransactionalTable(table)
-              && hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_STRICT_MANAGED_TABLES)
-              && (table.getTableType() == TableType.MANAGED_TABLE)) {
-        Hive hiveDb = Hive.get(hiveConf);
-        //TODO : dump metadata should be read to make sure that migration is required.
-        HiveStrictManagedMigration.TableMigrationOption migrationOption =

Review comment:
       Remove the imports for HiveStrictManagedMigration

##########
File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
##########
@@ -183,6 +183,7 @@ static void internalBeforeClassSetup(Map<String, String> additionalProperties, b
     hconf.setBoolVar(HiveConf.ConfVars.HIVEOPTIMIZEMETADATAQUERIES, true);

Review comment:
       Also remove uses of this:  "private static boolean isMigrationTest;" from this class

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
##########
@@ -207,22 +207,6 @@ private void parsePartitionSpec(ASTNode tableNode, LinkedHashMap<String, String>
     }
   }
 
-  private static void upgradeTableDesc(org.apache.hadoop.hive.metastore.api.Table tableObj, MetaData rv,
-                                       EximUtil.SemanticAnalyzerWrapperContext x)
-          throws IOException, TException, HiveException {
-    x.getLOG().debug("Converting table " + tableObj.getTableName() + " of type " + tableObj.getTableType() +
-            " with para " + tableObj.getParameters());
-    //TODO : isPathOwnedByHive is hard coded to true, need to get it from repl dump metadata.
-    TableType tableType = TableType.valueOf(tableObj.getTableType());
-    HiveStrictManagedMigration.TableMigrationOption migrationOption =
-            HiveStrictManagedMigration.determineMigrationTypeAutomatically(tableObj, tableType,
-                    null, x.getConf(), x.getHive().getMSC(), true);
-    HiveStrictManagedMigration.migrateTable(tableObj, tableType, migrationOption, false,

Review comment:
       Do we need this HiveStrictManagedMigration.java anymore? Or may be partially?

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/util/ReplUtils.java
##########
@@ -264,10 +230,6 @@ private static void addOpenTxnTaskForMigration(String actualDbName, String actua
           throws IOException, TException {
     List<Task<?>> taskList = new ArrayList<>();
     taskList.add(childTask);
-    if (isTableMigratingToTransactional(conf, tableObj) && updatedMetaDataTracker != null) {

Review comment:
       We can remove the entire method (addOpenTxnTaskForMigration) as it doesn't do anything apart from creating a list and adding child task to it. We can move that statement where this is getting called.

##########
File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationWithTableMigration.java
##########
@@ -1,577 +0,0 @@
-/*
- * 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.parse;
-
-import org.apache.hadoop.fs.FSDataOutputStream;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.fs.permission.FsPermission;
-import org.apache.hadoop.hdfs.DistributedFileSystem;
-import org.apache.hadoop.hdfs.MiniDFSCluster;
-import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.hadoop.hive.metastore.InjectableBehaviourObjectStore;
-import org.apache.hadoop.hive.metastore.InjectableBehaviourObjectStore.CallerArguments;
-import org.apache.hadoop.hive.metastore.InjectableBehaviourObjectStore.BehaviourInjection;
-import org.apache.hadoop.hive.metastore.api.Partition;
-import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
-import org.apache.hadoop.hive.metastore.messaging.json.gzip.GzipJSONMessageEncoder;
-import org.apache.hadoop.hive.shims.Utils;
-import org.apache.hadoop.hive.metastore.api.Table;
-import org.apache.hadoop.hive.metastore.utils.MetaStoreUtils;
-import org.apache.hadoop.hive.ql.parse.repl.PathBuilder;
-import static org.apache.hadoop.hive.metastore.ReplChangeManager.SOURCE_OF_REPLICATION;
-
-import org.apache.hadoop.security.UserGroupInformation;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Nullable;
-import org.junit.rules.TestName;
-import static org.apache.hadoop.hive.ql.io.AcidUtils.isFullAcidTable;
-import static org.apache.hadoop.hive.ql.io.AcidUtils.isTransactionalTable;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * TestReplicationWithTableMigration - test replication for Hive2 to Hive3 (Strict managed tables)

Review comment:
       Remove the reference from testutils/ptest2/conf/deployed/master-mr2.properties

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
##########
@@ -207,22 +207,6 @@ private void parsePartitionSpec(ASTNode tableNode, LinkedHashMap<String, String>
     }
   }
 
-  private static void upgradeTableDesc(org.apache.hadoop.hive.metastore.api.Table tableObj, MetaData rv,
-                                       EximUtil.SemanticAnalyzerWrapperContext x)
-          throws IOException, TException, HiveException {
-    x.getLOG().debug("Converting table " + tableObj.getTableName() + " of type " + tableObj.getTableType() +
-            " with para " + tableObj.getParameters());
-    //TODO : isPathOwnedByHive is hard coded to true, need to get it from repl dump metadata.
-    TableType tableType = TableType.valueOf(tableObj.getTableType());
-    HiveStrictManagedMigration.TableMigrationOption migrationOption =
-            HiveStrictManagedMigration.determineMigrationTypeAutomatically(tableObj, tableType,
-                    null, x.getConf(), x.getHive().getMSC(), true);
-    HiveStrictManagedMigration.migrateTable(tableObj, tableType, migrationOption, false,

Review comment:
       Also, this strictmanagedmigration.sh




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org