[ 
https://issues.apache.org/jira/browse/HIVE-23076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17073469#comment-17073469
 ] 

Denys Kuzmenko edited comment on HIVE-23076 at 4/2/20, 7:51 AM:
----------------------------------------------------------------

[~pvary], I think this is more readable, please validate :)
{code}
    LongStream.range(0, numTxns).forEach(i->{
      ps.setLong(1, i + firstTxnId);
      if ((i+1) % batchSize == 0) {
        ps.executeBatch();
      }
    });
    if (numTxns % batchSize != 0) {
      ps.executeBatch();
    }
{code}

Please check minHistoryQuery batching conditions as well, there is an issue. 
Besides that LGTM.


was (Author: dkuzmenko):
[~pvary], I think this is more readable, please validate :)
{code}
    LongStream.range(0, numTxns).forEach(i->{
      ps.setLong(1, i + firstTxnId);
      if ((i+1) % batchSize == 0) {
        ps.executeBatch();
      }
    });
    if (numTxns % batchSize != 0) {
      ps.executeBatch();
    }
{code}

> Add batching for openTxn
> ------------------------
>
>                 Key: HIVE-23076
>                 URL: https://issues.apache.org/jira/browse/HIVE-23076
>             Project: Hive
>          Issue Type: Bug
>          Components: Transactions
>            Reporter: Peter Vary
>            Assignee: Peter Vary
>            Priority: Major
>         Attachments: HIVE-23076.2.patch, HIVE-23076.3.patch, 
> HIVE-23076.4.patch, HIVE-23076.5.patch, HIVE-23076.6.patch, 
> HIVE-23076.7.patch, HIVE-23076.8.patch, HIVE-23076.9.patch, HIVE-23076.patch
>
>




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

Reply via email to