dengzhhu653 commented on code in PR #6347:
URL: https://github.com/apache/hive/pull/6347#discussion_r2888031885
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java:
##########
@@ -852,10 +852,23 @@ public int getMaxRows(int batch, int paramSize) {
// SQL Server supports a maximum of 2100 parameters in a request. Adjust
the maxRowsInBatch accordingly
int maxAllowedRows = (2100 - paramSize) / paramSize;
return Math.min(batch, maxAllowedRows);
+ } else if (isPOSTGRES()) {
+ int maxAllowedRows = (32767 - paramSize) / paramSize;
+ return Math.min(batch, maxAllowedRows);
}
return batch;
}
+ public int getMaxBatch(int batch, int totalParameters) {
+ int minBatch = batch;
+ if (isSQLSERVER()) {
+ minBatch = (totalParameters + 2100) / 2100;
+ } else if (isPOSTGRES()) {
+ minBatch = (totalParameters + 32767) / 32767;
+ }
+ return batch <= 0 ? minBatch : Math.max(batch, minBatch);
Review Comment:
this is to calculate the minimum batch needed given the total query
parameters, not per row
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]