public int getMaxRows(int batch, int paramSize) {
    if (isSQLSERVER()) {
      // 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);
    }
    return batch;
  }
Get the max rows in a query with paramSize.
@param batch the configured batch size
@param paramSize the parameter size in a query statement
@return the max allowed rows in a query
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java