@Override
  public long length() {
    try {
      if (closed) {
        return writer.getPos();
      } else {
        return writer.getPos()
            + (writeStore.isColumnFlushNeeded() ? writeStore.getBufferedSize() : 0);
      }
    } catch (IOException e) {
      throw new RuntimeIOException(e, "Failed to get file length");
    }
  }
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