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

ASF GitHub Bot logged work on HIVE-23069:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Jul/20 11:42
            Start Date: 13/Jul/20 11:42
    Worklog Time Spent: 10m 
      Work Description: pkumarsinha commented on a change in pull request #1225:
URL: https://github.com/apache/hive/pull/1225#discussion_r453587433



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/events/InsertHandler.java
##########
@@ -76,16 +77,29 @@ public void handle(Context withinContext) throws Exception {
         withinContext.hiveConf);
     Iterable<String> files = eventMessage.getFiles();
 
+    boolean copyAtLoad = 
withinContext.hiveConf.getBoolVar(HiveConf.ConfVars.REPL_DATA_COPY_LAZY);
+
     /*
       * Insert into/overwrite operation shall operate on one or more 
partitions or even partitions from multiple tables.
       * But, Insert event is generated for each partition to which the data is 
inserted.
       * So, qlPtns list will have only one entry.
      */
     Partition ptn = (null == qlPtns || qlPtns.isEmpty()) ? null : 
qlPtns.get(0);
     if (files != null) {
-      // encoded filename/checksum of files, write into _files
-      for (String file : files) {
-        writeFileEntry(qlMdTable, ptn, file, withinContext);
+      if (copyAtLoad) {
+        // encoded filename/checksum of files, write into _files
+        Path dataPath = null;
+        if ((null == qlPtns) || qlPtns.isEmpty()) {
+          dataPath = new Path(withinContext.eventRoot, 
EximUtil.DATA_PATH_NAME);
+        } else {
+          dataPath = new Path(withinContext.eventRoot, EximUtil.DATA_PATH_NAME 
+ File.separator

Review comment:
       Will have to create multiple Path object and hence not preferring.

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/DirCopyWork.java
##########
@@ -51,4 +56,20 @@ public Path getFullyQualifiedSourcePath() {
   public Path getFullyQualifiedTargetPath() {
     return fullyQualifiedTargetPath;
   }
+
+  @Override
+  public String convertToString() {
+    StringBuilder objInStr = new StringBuilder();
+    objInStr.append(fullyQualifiedSourcePath)
+            .append(URI_SEPARATOR)
+            .append(fullyQualifiedTargetPath);
+    return objInStr.toString();
+  }
+
+  @Override
+  public void loadFromString(String objectInStr) {

Review comment:
       no

##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/events/CommitTxnHandler.java
##########
@@ -81,10 +88,13 @@ private void createDumpFile(Context withinContext, 
org.apache.hadoop.hive.ql.met
             withinContext.hiveConf);
 
     if ((null == qlPtns) || qlPtns.isEmpty()) {
-      writeDumpFiles(qlMdTable, null, fileListArray.get(0), withinContext);
+      Path dataPath = new Path(withinContext.eventRoot, 
EximUtil.DATA_PATH_NAME);
+      writeDumpFiles(qlMdTable, null, fileListArray.get(0), withinContext, 
dataPath);
     } else {
       for (int idx = 0; idx < qlPtns.size(); idx++) {
-        writeDumpFiles(qlMdTable, qlPtns.get(idx), fileListArray.get(idx), 
withinContext);
+        Path dataPath = new Path(withinContext.eventRoot, 
EximUtil.DATA_PATH_NAME + File.separator

Review comment:
       Will have to create multiple  Path object and hence not preferring.




----------------------------------------------------------------
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: 457995)
    Time Spent: 3h  (was: 2h 50m)

> Memory efficient iterator should be used during replication.
> ------------------------------------------------------------
>
>                 Key: HIVE-23069
>                 URL: https://issues.apache.org/jira/browse/HIVE-23069
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Pravin Sinha
>            Assignee: Pravin Sinha
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-23069.01.patch, HIVE-23069.02.patch
>
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> Currently the iterator used while copying table data is memory based. In case 
> of a database with very large number of table/partitions, such iterator may 
> cause HS2 process to go OOM.
> Also introduces a config option to run data copy tasks during repl load 
> operation.



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

Reply via email to