Fokko commented on issue #716:
URL: https://github.com/apache/iceberg-python/issues/716#issuecomment-2100409045

   @cgbur Thanks for raising this. Could you share the stack trace that you're 
seeing?
   
   I tried to reproduce it, but it works on my end:
   
   ```python
   def test_data_file_statistics_from_parquet_metadata_list(tmp_path_factory: 
pytest.TempPathFactory) -> None:
       pyarrow_list = pa.schema([
           pa.field("extras", pa.list_(pa.field("element", 
pa.struct([pa.field("key", pa.string()), pa.field("value", pa.string())]))))
       ])
       tbl = pa.Table.from_pylist([{'some_list': [{"key": "a", "value": 
"b"}]}], schema=pyarrow_list)
       file_path = tmp_path_factory.mktemp('test_statistics') / "test.parquet"
       pq.write_table(tbl, file_path)
   
       parquet_metadata = pq.read_metadata(file_path)
   
       iceberg_schema = Schema(
           NestedField(
               1,
               "extras",
               ListType(
                   10,
                   StructType(
                       NestedField(10, "key", StringType()),
                       NestedField(11, "value", StringType()),
                   ),
                   element_required=False,
               ),
           )
       )
   
       statistics = data_file_statistics_from_parquet_metadata(
           parquet_metadata=parquet_metadata,
           stats_columns=compute_statistics_plan(iceberg_schema, EMPTY_DICT),
           parquet_column_mapping=parquet_path_to_id_mapping(iceberg_schema),
       )
   
       assert statistics == DataFileStatistics(
           record_count=1,
           column_sizes={10: 51, 11: 51},
           value_counts={10: 1, 11: 1},
           null_value_counts={10: 1, 11: 1},
           nan_value_counts={},
           column_aggregates={},
           split_offsets=[4],
       )
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to