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/05 10:46:14 UTC

[GitHub] [hive] aasha opened a new pull request #1362: HIVE-23995 : Don't set location for managed tables in case of repl load

aasha opened a new pull request #1362:
URL: https://github.com/apache/hive/pull/1362


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description, screenshot and/or a reproducable example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Hive versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   


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


[GitHub] [hive] github-actions[bot] closed pull request #1362: HIVE-23995 : Don't set location for managed tables in case of repl load

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #1362:
URL: https://github.com/apache/hive/pull/1362


   


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


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

Posted by GitBox <gi...@apache.org>.
aasha commented on a change in pull request #1362:
URL: https://github.com/apache/hive/pull/1362#discussion_r468322813



##########
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:
       The other tests don't need this flag. Adding it here works fine. Tests are green.




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


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

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #1362:
URL: https://github.com/apache/hive/pull/1362#issuecomment-706632436


   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


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


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

Posted by GitBox <gi...@apache.org>.
aasha commented on a change in pull request #1362:
URL: https://github.com/apache/hive/pull/1362#discussion_r468320690



##########
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:
       yes




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


[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

Posted by GitBox <gi...@apache.org>.
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