private static int querySizeExpected(int sizeSoFar,
                                       int sizeNextItem,
                                       int suffixSize,
                                       boolean addParens) {

    int size = sizeSoFar + sizeNextItem + suffixSize;

    if (addParens) {
       size++;
    }

    return size;
  }
Compute and return the size of a query statement with the given parameters as input variables.

@param sizeSoFar     size of the current contents of the buf
@param sizeNextItem      size of the next 'IN' clause element value.
@param suffixSize    size of the suffix for a quey statement
@param addParens     Do we add an additional parenthesis?
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnUtils.java