private void checkSize() {
    if (recordCount >= nextCheckRecordCount) {
      long bufferedSize = writeStore.getBufferedSize();
      double avgRecordSize = ((double) bufferedSize) / recordCount;

      if (bufferedSize > (nextRowGroupSize - 2 * avgRecordSize)) {
        flushRowGroup(false);
      } else {
        long remainingSpace = nextRowGroupSize - bufferedSize;
        long remainingRecords = (long) (remainingSpace / avgRecordSize);
        this.nextCheckRecordCount =
            recordCount + Math.min(Math.max(remainingRecords / 2, 100), 10000);
      }
    }
  }
Returns the approximate length of the output file produced by this writer.

<p>Prior to calling {@link AdaptHiveParquetWriter#close}, the result is approximate. After
calling close, the length is exact.

@return the approximate length of the output file produced by this writer or the exact length
    if this writer is closed.
amoro-format-mixed/amoro-mixed-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetWriter.java