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 07:24:27 UTC

[GitHub] [hive] vpnvishv opened a new pull request #1382: HIVE-24020: Fix Automatic compaction for streaming ingest with dynamic partition

vpnvishv opened a new pull request #1382:
URL: https://github.com/apache/hive/pull/1382


   <!--
   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?
   We need to keep info about the updated partition as well, and pass this to addDynamicPartitions. Here i am reusing addedParitions, as I don't see any effect on stats either. Reviewers please suggest if you think it can affect.
   
   ### Why are the changes needed?
   To fix automatic compaction in case of streaming ingest with dynamic partition.
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   Added unit-test.
   


----------------------------------------------------------------
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] vpnvishv commented on pull request #1382: HIVE-24020: Fix Automatic compaction for streaming ingest with dynamic partition

Posted by GitBox <gi...@apache.org>.
vpnvishv commented on pull request #1382:
URL: https://github.com/apache/hive/pull/1382#issuecomment-681015240


   @pvary @prasanthj  Can you please merge this PR.


----------------------------------------------------------------
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] vpnvishv commented on pull request #1382: HIVE-24020: Fix Automatic compaction for streaming ingest with dynamic partition

Posted by GitBox <gi...@apache.org>.
vpnvishv commented on pull request #1382:
URL: https://github.com/apache/hive/pull/1382#issuecomment-673473084


   @pvary @laszlopinter86 @klcopp Can you please review.


----------------------------------------------------------------
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] vpnvishv commented on a change in pull request #1382: HIVE-24020: Fix Automatic compaction for streaming ingest with dynamic partition

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



##########
File path: streaming/src/java/org/apache/hive/streaming/AbstractRecordWriter.java
##########
@@ -581,16 +582,9 @@ protected RecordUpdater getRecordUpdater(List<String> partitionValues, int bucke
           destLocation = new Path(table.getSd().getLocation());
         } else {
           PartitionInfo partitionInfo = conn.createPartitionIfNotExists(partitionValues);
-          // collect the newly added partitions. connection.commitTransaction() will report the dynamically added
-          // partitions to TxnHandler
-          if (!partitionInfo.isExists()) {
-            addedPartitions.add(partitionInfo.getName());
-          } else {
-            if (LOG.isDebugEnabled()) {
-              LOG.debug("Partition {} already exists for table {}",
-                  partitionInfo.getName(), fullyQualifiedTableName);
-            }
-          }
+          // collect the newly added/updated partitions. connection.commitTransaction() will report the dynamically
+          // added partitions to TxnHandler
+          addedPartitions.add(partitionInfo.getName());

Review comment:
       Done.




----------------------------------------------------------------
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] pvary commented on a change in pull request #1382: HIVE-24020: Fix Automatic compaction for streaming ingest with dynamic partition

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



##########
File path: streaming/src/java/org/apache/hive/streaming/AbstractRecordWriter.java
##########
@@ -581,16 +582,9 @@ protected RecordUpdater getRecordUpdater(List<String> partitionValues, int bucke
           destLocation = new Path(table.getSd().getLocation());
         } else {
           PartitionInfo partitionInfo = conn.createPartitionIfNotExists(partitionValues);
-          // collect the newly added partitions. connection.commitTransaction() will report the dynamically added
-          // partitions to TxnHandler
-          if (!partitionInfo.isExists()) {
-            addedPartitions.add(partitionInfo.getName());
-          } else {
-            if (LOG.isDebugEnabled()) {
-              LOG.debug("Partition {} already exists for table {}",
-                  partitionInfo.getName(), fullyQualifiedTableName);
-            }
-          }
+          // collect the newly added/updated partitions. connection.commitTransaction() will report the dynamically
+          // added partitions to TxnHandler
+          addedPartitions.add(partitionInfo.getName());

Review comment:
       Can we please rename the 'addedPartitions' to something like more resembling the actual usage, like 'updatedPartitions', or 'changedPartitions', or whatever? Maybe a comment on the attribute/and getter should be good as well.
   Otherwise LGTM.
   Thanks, Peter




----------------------------------------------------------------
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] prasanthj merged pull request #1382: HIVE-24020: Fix Automatic compaction for streaming ingest with dynamic partition

Posted by GitBox <gi...@apache.org>.
prasanthj merged pull request #1382:
URL: https://github.com/apache/hive/pull/1382


   


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