[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-08-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=473732=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-473732
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 24/Aug/20 04:24
Start Date: 24/Aug/20 04:24
Worklog Time Spent: 10m 
  Work Description: pkumarsinha closed pull request #1084:
URL: https://github.com/apache/hive/pull/1084


   



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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 473732)
Time Spent: 2h 50m  (was: 2h 40m)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 2h 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-08-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=473715=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-473715
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 24/Aug/20 00:41
Start Date: 24/Aug/20 00:41
Worklog Time Spent: 10m 
  Work Description: github-actions[bot] commented on pull request #1084:
URL: https://github.com/apache/hive/pull/1084#issuecomment-678849350


   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 d...@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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 473715)
Time Spent: 2h 40m  (was: 2.5h)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-16 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=446576=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-446576
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 16/Jun/20 15:13
Start Date: 16/Jun/20 15:13
Worklog Time Spent: 10m 
  Work Description: pkumarsinha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r440929491



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/load/table/LoadPartitions.java
##
@@ -243,29 +246,34 @@ private void addPartition(boolean hasMorePartitions, 
AlterTableAddPartitionDesc
   : LoadFileType.OVERWRITE_EXISTING);
   stagingDir = 
PathUtils.getExternalTmpPath(replicaWarehousePartitionLocation, 
context.pathInfo);
 }
-
-Task copyTask = ReplCopyTask.getLoadCopyTask(
-event.replicationSpec(),
-new Path(event.dataPath() + Path.SEPARATOR + 
getPartitionName(sourceWarehousePartitionLocation)),
-stagingDir,
-context.hiveConf, false, false
-);
-
+Path partDataSrc = new Path(event.dataPath() + File.separator + 
getPartitionName(sourceWarehousePartitionLocation));
+Path moveSource = performOnlyMove ? partDataSrc : stagingDir;
 Task movePartitionTask = null;
 if (loadFileType != LoadFileType.IGNORE) {
   // no need to create move task, if file is moved directly to target 
location.
-  movePartitionTask = movePartitionTask(table, partSpec, stagingDir, 
loadFileType);
+  movePartitionTask = movePartitionTask(table, partSpec, moveSource, 
loadFileType);
 }
-
-if (ptnRootTask == null) {
-  ptnRootTask = copyTask;
+if (performOnlyMove) {
+  if (ptnRootTask == null) {
+ptnRootTask = addPartTask;

Review comment:
   Not changing anything with respect to addPartTask. Just the copy-move is 
getting replaced with single move. 





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 446576)
Time Spent: 2.5h  (was: 2h 20m)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-16 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=446571=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-446571
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 16/Jun/20 15:03
Start Date: 16/Jun/20 15:03
Worklog Time Spent: 10m 
  Work Description: pkumarsinha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r440922085



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/load/table/LoadPartitions.java
##
@@ -320,7 +334,7 @@ private void addPartition(boolean hasMorePartitions, 
AlterTableAddPartitionDesc
   private String getPartitionName(Path partitionMetadataFullPath) {
 //Get partition name by removing the metadata base path.
 //Needed for getting the data path
-return 
partitionMetadataFullPath.toString().substring(event.metadataPath().toString().length());
+return 
partitionMetadataFullPath.toString().substring(event.metadataPath().toString().length()
 + 1);

Review comment:
   Existing method. just changing the index





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 446571)
Time Spent: 2h 20m  (was: 2h 10m)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-16 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=446569=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-446569
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 16/Jun/20 15:02
Start Date: 16/Jun/20 15:02
Worklog Time Spent: 10m 
  Work Description: pkumarsinha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r440921354



##
File path: 
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosAcidTables.java
##
@@ -1596,6 +1595,10 @@ public void testCheckPointingWithNewTablesAdded() throws 
Throwable {
 .run("insert into t3 values (3)")
 .dump(primaryDbName, dumpClause);
 
+assertEquals(modifiedTimeTable1, 
fs.getFileStatus(tablet1Path).getModificationTime());

Review comment:
   Same as above





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 446569)
Time Spent: 2h 10m  (was: 2h)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-16 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=446568=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-446568
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 16/Jun/20 15:02
Start Date: 16/Jun/20 15:02
Worklog Time Spent: 10m 
  Work Description: pkumarsinha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r440921202



##
File path: 
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosAcidTables.java
##
@@ -1539,15 +1539,14 @@ public void 
testCheckPointingWithSourceTableDataInserted() throws Throwable {
 .run("insert into t2 values (24)")
 .run("insert into t1 values (4)")
 .dump(primaryDbName, dumpClause);
-
+assertEquals(modifiedTimeTable1CopyFile, 
fs.listStatus(tablet1Path)[0].getModificationTime());

Review comment:
   because data is moved now. We are checking this late





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 446568)
Time Spent: 2h  (was: 1h 50m)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 2h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-16 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=446567=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-446567
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 16/Jun/20 15:01
Start Date: 16/Jun/20 15:01
Worklog Time Spent: 10m 
  Work Description: pkumarsinha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r440920857



##
File path: 
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExclusiveReplica.java
##
@@ -179,6 +179,63 @@ public void externalTableReplicationWithLocalStaging() 
throws Throwable {
 .verifyResult("800");
   }
 
+  @Test

Review comment:
   Comment not clear





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 446567)
Time Spent: 1h 50m  (was: 1h 40m)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-16 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=446527=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-446527
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 16/Jun/20 13:53
Start Date: 16/Jun/20 13:53
Worklog Time Spent: 10m 
  Work Description: aasha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r440855768



##
File path: 
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosAcidTables.java
##
@@ -1539,15 +1539,14 @@ public void 
testCheckPointingWithSourceTableDataInserted() throws Throwable {
 .run("insert into t2 values (24)")
 .run("insert into t1 values (4)")
 .dump(primaryDbName, dumpClause);
-
+assertEquals(modifiedTimeTable1CopyFile, 
fs.listStatus(tablet1Path)[0].getModificationTime());

Review comment:
   Why is this changed?

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/load/table/LoadPartitions.java
##
@@ -243,29 +246,34 @@ private void addPartition(boolean hasMorePartitions, 
AlterTableAddPartitionDesc
   : LoadFileType.OVERWRITE_EXISTING);
   stagingDir = 
PathUtils.getExternalTmpPath(replicaWarehousePartitionLocation, 
context.pathInfo);
 }
-
-Task copyTask = ReplCopyTask.getLoadCopyTask(
-event.replicationSpec(),
-new Path(event.dataPath() + Path.SEPARATOR + 
getPartitionName(sourceWarehousePartitionLocation)),
-stagingDir,
-context.hiveConf, false, false
-);
-
+Path partDataSrc = new Path(event.dataPath() + File.separator + 
getPartitionName(sourceWarehousePartitionLocation));
+Path moveSource = performOnlyMove ? partDataSrc : stagingDir;
 Task movePartitionTask = null;
 if (loadFileType != LoadFileType.IGNORE) {
   // no need to create move task, if file is moved directly to target 
location.
-  movePartitionTask = movePartitionTask(table, partSpec, stagingDir, 
loadFileType);
+  movePartitionTask = movePartitionTask(table, partSpec, moveSource, 
loadFileType);
 }
-
-if (ptnRootTask == null) {
-  ptnRootTask = copyTask;
+if (performOnlyMove) {
+  if (ptnRootTask == null) {
+ptnRootTask = addPartTask;

Review comment:
   How was addPartTask added before your change?

##
File path: 
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExclusiveReplica.java
##
@@ -179,6 +179,63 @@ public void externalTableReplicationWithLocalStaging() 
throws Throwable {
 .verifyResult("800");
   }
 
+  @Test
+  public void testHdfsMoveOptimizationOnTargetStaging() throws Throwable {

Review comment:
   Check for empty staging as the data is moved.

##
File path: 
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosAcidTables.java
##
@@ -1596,6 +1595,10 @@ public void testCheckPointingWithNewTablesAdded() throws 
Throwable {
 .run("insert into t3 values (3)")
 .dump(primaryDbName, dumpClause);
 
+assertEquals(modifiedTimeTable1, 
fs.getFileStatus(tablet1Path).getModificationTime());

Review comment:
   Why is this changed?

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/load/table/LoadPartitions.java
##
@@ -320,7 +334,7 @@ private void addPartition(boolean hasMorePartitions, 
AlterTableAddPartitionDesc
   private String getPartitionName(Path partitionMetadataFullPath) {
 //Get partition name by removing the metadata base path.
 //Needed for getting the data path
-return 
partitionMetadataFullPath.toString().substring(event.metadataPath().toString().length());
+return 
partitionMetadataFullPath.toString().substring(event.metadataPath().toString().length()
 + 1);

Review comment:
   Can we do a split instead at '/'. This may be error prone

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
##
@@ -686,9 +700,25 @@ private static ImportTableDesc 
getBaseCreateTableDescFromTable(String dbName,
 loadTableWork.setInheritTableSpecs(false);
 moveWork.setLoadTableWork(loadTableWork);
   }
+  Task loadPartTask = TaskFactory.get(moveWork, x.getConf());
+  if (performOnlyMove) {
+if (addPartTask != null) {
+  addPartTask.addDependentTask(loadPartTask);
+}
+x.getTasks().add(loadPartTask);
+return addPartTask == null ? loadPartTask : addPartTask;
+  }
+
+  Task copyTask = null;
+  if (replicationSpec.isInReplicationScope()) {

Review comment:
   This check is already done before. Can be simplified

##
File path: 

[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-11 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=444307=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-444307
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 11/Jun/20 14:55
Start Date: 11/Jun/20 14:55
Worklog Time Spent: 10m 
  Work Description: pkumarsinha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r438847033



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/load/table/LoadPartitions.java
##
@@ -243,29 +246,34 @@ private void addPartition(boolean hasMorePartitions, 
AlterTableAddPartitionDesc
   : LoadFileType.OVERWRITE_EXISTING);
   stagingDir = 
PathUtils.getExternalTmpPath(replicaWarehousePartitionLocation, 
context.pathInfo);
 }
-
-Task copyTask = ReplCopyTask.getLoadCopyTask(
-event.replicationSpec(),
-new Path(event.dataPath() + Path.SEPARATOR + 
getPartitionName(sourceWarehousePartitionLocation)),
-stagingDir,
-context.hiveConf, false, false
-);
-
+Path partDataSrc = new Path(event.dataPath() + File.separator + 
getPartitionName(sourceWarehousePartitionLocation));
+Path moveSource = performOnlyMove ? partDataSrc : stagingDir;
 Task movePartitionTask = null;
 if (loadFileType != LoadFileType.IGNORE) {
   // no need to create move task, if file is moved directly to target 
location.
-  movePartitionTask = movePartitionTask(table, partSpec, stagingDir, 
loadFileType);
+  movePartitionTask = movePartitionTask(table, partSpec, moveSource, 
loadFileType);
 }
-
-if (ptnRootTask == null) {
-  ptnRootTask = copyTask;
+if (performOnlyMove) {
+  if (ptnRootTask == null) {
+ptnRootTask = addPartTask;

Review comment:
   No, that happens only when isOnlyDDLOperation is true. It doesn't come 
down in to this line in that case.





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 444307)
Time Spent: 1.5h  (was: 1h 20m)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-11 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=444304=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-444304
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 11/Jun/20 14:50
Start Date: 11/Jun/20 14:50
Worklog Time Spent: 10m 
  Work Description: pkumarsinha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r438843549



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
##
@@ -452,7 +453,7 @@ private static ImportTableDesc 
getBaseCreateTableDescFromTable(String dbName,
 boolean isAutoPurge = false;
 boolean needRecycle = false;
 boolean copyToMigratedTxnTable = replicationSpec.isMigratingToTxnTable();
-
+boolean performOnlyMove = replicationSpec.isInReplicationScope() && 
Utils.onSameHDFSFileSystem(dataPath, tgtPath);

Review comment:
   As we would like to use it only in replication cases.





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 444304)
Time Spent: 1h 20m  (was: 1h 10m)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-11 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=444303=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-444303
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 11/Jun/20 14:48
Start Date: 11/Jun/20 14:48
Worklog Time Spent: 10m 
  Work Description: pkumarsinha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r438842356



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
##
@@ -686,9 +687,25 @@ private static ImportTableDesc 
getBaseCreateTableDescFromTable(String dbName,
 loadTableWork.setInheritTableSpecs(false);
 moveWork.setLoadTableWork(loadTableWork);
   }
+  Task loadPartTask = TaskFactory.get(moveWork, x.getConf());
+  if (performOnlyMove) {
+if (addPartTask != null) {
+  addPartTask.addDependentTask(loadPartTask);
+}
+x.getTasks().add(loadPartTask);
+return addPartTask == null ? loadPartTask : addPartTask;

Review comment:
   Yes, but then we will have to have two return statements which I wanted 
to avoid.





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 444303)
Time Spent: 1h 10m  (was: 1h)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-11 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=444301=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-444301
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 11/Jun/20 14:46
Start Date: 11/Jun/20 14:46
Worklog Time Spent: 10m 
  Work Description: pkumarsinha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r438840991



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/load/table/LoadTable.java
##
@@ -297,17 +298,15 @@ static TableLocationTuple tableLocation(ImportTableDesc 
tblDesc, Database parent
 LOG.debug("adding dependent CopyWork/AddPart/MoveWork for table "
 + table.getCompleteName() + " with source location: "
 + dataPath.toString() + " and target location " + 
tgtPath.toString());
-
-Task copyTask = ReplCopyTask.getLoadCopyTask(replicationSpec, dataPath, 
tmpPath, context.hiveConf,
-false, false);
+Path moveSrcPath = performOnlyMove ? dataPath : tmpPath;

Review comment:
   moveSrcPath is the path used to perform move data to final warehouse dir 
on target.





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 444301)
Time Spent: 1h  (was: 50m)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 1h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-11 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=444297=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-444297
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 11/Jun/20 14:44
Start Date: 11/Jun/20 14:44
Worklog Time Spent: 10m 
  Work Description: pkumarsinha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r438839329



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/load/table/LoadPartitions.java
##
@@ -243,29 +246,34 @@ private void addPartition(boolean hasMorePartitions, 
AlterTableAddPartitionDesc
   : LoadFileType.OVERWRITE_EXISTING);
   stagingDir = 
PathUtils.getExternalTmpPath(replicaWarehousePartitionLocation, 
context.pathInfo);
 }
-
-Task copyTask = ReplCopyTask.getLoadCopyTask(
-event.replicationSpec(),
-new Path(event.dataPath() + Path.SEPARATOR + 
getPartitionName(sourceWarehousePartitionLocation)),
-stagingDir,
-context.hiveConf, false, false
-);
-
+Path partDataSrc = new Path(event.dataPath() + File.separator + 
getPartitionName(sourceWarehousePartitionLocation));
+Path moveSource = performOnlyMove ? partDataSrc : stagingDir;
 Task movePartitionTask = null;
 if (loadFileType != LoadFileType.IGNORE) {
   // no need to create move task, if file is moved directly to target 
location.
-  movePartitionTask = movePartitionTask(table, partSpec, stagingDir, 
loadFileType);
+  movePartitionTask = movePartitionTask(table, partSpec, moveSource, 
loadFileType);

Review comment:
   Path moveSource = performOnlyMove ? partDataSrc : stagingDir;
   Move src is either partDataSrc(which is repl Staging dir) or load's own 
local staging dir which is used to do operation,





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 444297)
Time Spent: 40m  (was: 0.5h)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-11 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=444298=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-444298
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 11/Jun/20 14:44
Start Date: 11/Jun/20 14:44
Worklog Time Spent: 10m 
  Work Description: pkumarsinha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r438839329



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/load/table/LoadPartitions.java
##
@@ -243,29 +246,34 @@ private void addPartition(boolean hasMorePartitions, 
AlterTableAddPartitionDesc
   : LoadFileType.OVERWRITE_EXISTING);
   stagingDir = 
PathUtils.getExternalTmpPath(replicaWarehousePartitionLocation, 
context.pathInfo);
 }
-
-Task copyTask = ReplCopyTask.getLoadCopyTask(
-event.replicationSpec(),
-new Path(event.dataPath() + Path.SEPARATOR + 
getPartitionName(sourceWarehousePartitionLocation)),
-stagingDir,
-context.hiveConf, false, false
-);
-
+Path partDataSrc = new Path(event.dataPath() + File.separator + 
getPartitionName(sourceWarehousePartitionLocation));
+Path moveSource = performOnlyMove ? partDataSrc : stagingDir;
 Task movePartitionTask = null;
 if (loadFileType != LoadFileType.IGNORE) {
   // no need to create move task, if file is moved directly to target 
location.
-  movePartitionTask = movePartitionTask(table, partSpec, stagingDir, 
loadFileType);
+  movePartitionTask = movePartitionTask(table, partSpec, moveSource, 
loadFileType);

Review comment:
   Path moveSource = performOnlyMove ? partDataSrc : stagingDir;
   Move src is either partDataSrc(which is repl Staging dir) or load's own 
local staging dir which is used to do data copy operation.





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 444298)
Time Spent: 50m  (was: 40m)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-11 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=444295=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-444295
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 11/Jun/20 14:40
Start Date: 11/Jun/20 14:40
Worklog Time Spent: 10m 
  Work Description: pkumarsinha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r438836524



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/load/table/LoadPartitions.java
##
@@ -243,29 +246,34 @@ private void addPartition(boolean hasMorePartitions, 
AlterTableAddPartitionDesc
   : LoadFileType.OVERWRITE_EXISTING);
   stagingDir = 
PathUtils.getExternalTmpPath(replicaWarehousePartitionLocation, 
context.pathInfo);
 }
-
-Task copyTask = ReplCopyTask.getLoadCopyTask(
-event.replicationSpec(),
-new Path(event.dataPath() + Path.SEPARATOR + 
getPartitionName(sourceWarehousePartitionLocation)),
-stagingDir,
-context.hiveConf, false, false
-);
-
+Path partDataSrc = new Path(event.dataPath() + File.separator + 
getPartitionName(sourceWarehousePartitionLocation));

Review comment:
   Normally yes, but in this case it will not as 
getPartitionName(sourceWarehousePartitionLocation) returns value with / 
attached. Path will take that itself as final path.





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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 444295)
Time Spent: 0.5h  (was: 20m)

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-11 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=444265=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-444265
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 11/Jun/20 13:36
Start Date: 11/Jun/20 13:36
Worklog Time Spent: 10m 
  Work Description: aasha commented on a change in pull request #1084:
URL: https://github.com/apache/hive/pull/1084#discussion_r438162512



##
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/Utils.java
##
@@ -367,6 +369,17 @@ public static boolean shouldReplicate(NotificationEvent 
tableForEvent,
 }
   }
 
+  public static boolean onSameHDFSFileSystem(Path dataPath, Path tgtPath) {

Review comment:
   Unit tests for this method

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/load/table/LoadPartitions.java
##
@@ -243,29 +246,34 @@ private void addPartition(boolean hasMorePartitions, 
AlterTableAddPartitionDesc
   : LoadFileType.OVERWRITE_EXISTING);
   stagingDir = 
PathUtils.getExternalTmpPath(replicaWarehousePartitionLocation, 
context.pathInfo);
 }
-
-Task copyTask = ReplCopyTask.getLoadCopyTask(
-event.replicationSpec(),
-new Path(event.dataPath() + Path.SEPARATOR + 
getPartitionName(sourceWarehousePartitionLocation)),
-stagingDir,
-context.hiveConf, false, false
-);
-
+Path partDataSrc = new Path(event.dataPath() + File.separator + 
getPartitionName(sourceWarehousePartitionLocation));

Review comment:
   Can create a path directly from the constructor of Path instead of using 
File Separator

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
##
@@ -686,9 +687,25 @@ private static ImportTableDesc 
getBaseCreateTableDescFromTable(String dbName,
 loadTableWork.setInheritTableSpecs(false);
 moveWork.setLoadTableWork(loadTableWork);
   }
+  Task loadPartTask = TaskFactory.get(moveWork, x.getConf());
+  if (performOnlyMove) {
+if (addPartTask != null) {
+  addPartTask.addDependentTask(loadPartTask);
+}
+x.getTasks().add(loadPartTask);
+return addPartTask == null ? loadPartTask : addPartTask;

Review comment:
   can be simplified. There is already a not null check above

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
##
@@ -452,7 +453,7 @@ private static ImportTableDesc 
getBaseCreateTableDescFromTable(String dbName,
 boolean isAutoPurge = false;
 boolean needRecycle = false;
 boolean copyToMigratedTxnTable = replicationSpec.isMigratingToTxnTable();
-
+boolean performOnlyMove = replicationSpec.isInReplicationScope() && 
Utils.onSameHDFSFileSystem(dataPath, tgtPath);

Review comment:
   why do we need this extra condition 
replicationSpec.isInReplicationScope()?

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/load/table/LoadPartitions.java
##
@@ -243,29 +246,34 @@ private void addPartition(boolean hasMorePartitions, 
AlterTableAddPartitionDesc
   : LoadFileType.OVERWRITE_EXISTING);
   stagingDir = 
PathUtils.getExternalTmpPath(replicaWarehousePartitionLocation, 
context.pathInfo);
 }
-
-Task copyTask = ReplCopyTask.getLoadCopyTask(
-event.replicationSpec(),
-new Path(event.dataPath() + Path.SEPARATOR + 
getPartitionName(sourceWarehousePartitionLocation)),
-stagingDir,
-context.hiveConf, false, false
-);
-
+Path partDataSrc = new Path(event.dataPath() + File.separator + 
getPartitionName(sourceWarehousePartitionLocation));
+Path moveSource = performOnlyMove ? partDataSrc : stagingDir;
 Task movePartitionTask = null;
 if (loadFileType != LoadFileType.IGNORE) {
   // no need to create move task, if file is moved directly to target 
location.
-  movePartitionTask = movePartitionTask(table, partSpec, stagingDir, 
loadFileType);
+  movePartitionTask = movePartitionTask(table, partSpec, moveSource, 
loadFileType);
 }
-
-if (ptnRootTask == null) {
-  ptnRootTask = copyTask;
+if (performOnlyMove) {
+  if (ptnRootTask == null) {
+ptnRootTask = addPartTask;

Review comment:
   will the addPartTask not be added already as part of DDL operation?

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/bootstrap/load/table/LoadPartitions.java
##
@@ -225,6 +227,7 @@ private void addPartition(boolean hasMorePartitions, 
AlterTableAddPartitionDesc
 }
 
 Path stagingDir = replicaWarehousePartitionLocation;
+boolean performOnlyMove = Utils.onSameHDFSFileSystem(event.dataPath(), 
replicaWarehousePartitionLocation);

Review comment:
   can use stagingDir instead of 

[jira] [Work logged] (HIVE-23539) Optimize data copy during repl load operation for HDFS based staging location

2020-06-09 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-23539?focusedWorklogId=443269=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-443269
 ]

ASF GitHub Bot logged work on HIVE-23539:
-

Author: ASF GitHub Bot
Created on: 09/Jun/20 16:48
Start Date: 09/Jun/20 16:48
Worklog Time Spent: 10m 
  Work Description: pkumarsinha opened a new pull request #1084:
URL: https://github.com/apache/hive/pull/1084


   …ased staging location
   
   ## NOTICE
   
   Please create an issue in ASF JIRA before opening a pull request,
   and you need to set the title of the pull request which starts with
   the corresponding JIRA issue number. (e.g. HIVE-X: Fix a typo in YYY)
   For more details, please see 
https://cwiki.apache.org/confluence/display/Hive/HowToContribute
   



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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 443269)
Remaining Estimate: 0h
Time Spent: 10m

> Optimize data copy during repl load operation for HDFS based staging location
> -
>
> Key: HIVE-23539
> URL: https://issues.apache.org/jira/browse/HIVE-23539
> Project: Hive
>  Issue Type: Improvement
>Reporter: Pravin Sinha
>Assignee: Pravin Sinha
>Priority: Major
> Attachments: HIVE-23539.01.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)