wecharyu opened a new pull request, #4678:
URL: https://github.com/apache/hive/pull/4678

   ### What changes were proposed in this pull request?
   1. Create a new common function named `addPartitionsInternal`
   2. Both `add_partitions` and `add_partition`  call this new common function.
   
   
   ### Why are the changes needed?
   1. Get the performance improvement in direct SQL for `add_partition`
   3. Code cleaner, reduce the duplicate code.
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### Is the change a dependency upgrade?
   No
   
   
   ### How was this patch tested?
   1. pass all existing add partition related tests
   2. add a benchmark test:
   ```shell
   java -jar ./hmsbench-jar-with-dependencies.jar -H localhost --savedata 
/tmp/benchdata --sanitize -N 10 -N 100 -N 1000 -o bench_results_direct.csv -C 
-d testbench_http --params=100  -E 'drop.*' -E 'renameTable.*' -E 
'getTableObjectsByName.*' -E 'listTables.*' -E 'listPartitions.*' -E 
'getPartitions.*' -E 'getPartitionsByNames.*' -E 'getPartitionNames.*' -E 
'listPartition' -E 'getPartition'  -E 'getNid' -E 'listDatabases' -E 'getTable' 
-E 'createTable' -E 'addPartitions.*'
   ```
   
   - before this patch
   ```shell
   Operation                      Mean     Med      Min      Max      Err%
   addPartition                   19.93    16.76    15.30    41.84    29.67
   addPartition.10                182.9    181.5    173.9    210.3    3.079
   addPartition.100               1846     1835     1792     2392     4.179
   addPartition.1000              1.850e+04 1.834e+04 1.806e+04 2.024e+04 2.422
   ```
   - after this patch
   ```shell
   Operation                      Mean     Med      Min      Max      Err%
   addPartition                   18.18    15.14    14.44    38.62    32.95
   addPartition.10                177.4    175.7    167.0    234.9    4.943
   addPartition.100               1797     1783     1735     2288     5.009
   addPartition.1000              1.791e+04 1.775e+04 1.750e+04 1.985e+04 2.294
   ```


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

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to