wypoon commented on code in PR #11247:
URL: https://github.com/apache/iceberg/pull/11247#discussion_r1795958912


##########
spark/v3.5/spark/src/test/resources/decimal_dict_and_plain_encoding.parquet:
##########


Review Comment:
   I also tried
   ```
       try (FileAppender<GenericData.Record> writer =
           Parquet.write(Files.localOutput(parquetFile))
               .schema(schema)
               .createWriterFunc(ParquetAvroWriter::buildWriter)
               .set(PARQUET_DICT_SIZE_BYTES, "2048")
               .set(PARQUET_PAGE_ROW_LIMIT, "100")
               .build()) {
         writer.addAll(records);
       }
   ```
   and debugged what happens in `writer`.
   The following chain is called to get the `ValuesWriter` for the decimal 
column:
   
https://github.com/apache/parquet-java/blob/apache-parquet-1.13.1/parquet-column/src/main/java/org/apache/parquet/column/impl/ColumnWriterBase.java#L84
   
https://github.com/apache/parquet-java/blob/apache-parquet-1.13.1/parquet-column/src/main/java/org/apache/parquet/column/ParquetProperties.java#L167
   
https://github.com/apache/parquet-java/blob/apache-parquet-1.13.1/parquet-column/src/main/java/org/apache/parquet/column/values/factory/DefaultValuesWriterFactory.java#L52
   
https://github.com/apache/parquet-java/blob/apache-parquet-1.13.1/parquet-column/src/main/java/org/apache/parquet/column/values/factory/DefaultV1ValuesWriterFactory.java#L55
   
https://github.com/apache/parquet-java/blob/apache-parquet-1.13.1/parquet-column/src/main/java/org/apache/parquet/column/values/factory/DefaultV1ValuesWriterFactory.java#L80
   which is the code I cited previously:
   ```
     private ValuesWriter getFixedLenByteArrayValuesWriter(ColumnDescriptor 
path) {
       // dictionary encoding was not enabled in PARQUET 1.0
       return new FixedLenByteArrayPlainValuesWriter(path.getTypeLength(), 
parquetProperties.getInitialSlabSize(), 
parquetProperties.getPageSizeThreshold(), parquetProperties.getAllocator());
     }
   ```
   I am using the `iceberg-parquet` APIs to create a writer, but eventually it 
calls `parquet-java` code.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to