kylebarron commented on issue #957:
URL: 
https://github.com/apache/datafusion-python/issues/957#issuecomment-2555859437

   In this case it's an issue with writing the Parquet file, not reading, which 
you can see if you try to read the file back with pyarrow:
   
   ```py
   In [23]: import pyarrow.parquet as pq
   
   In [24]: pq.read_schema(FILENAME)
   Out[24]:
   array: list<item: float>
     child 0, item: float
   ```
   
   In this case it's actually because the _writing_ side doesn't correctly 
propagate the Arrow metadata either. 
   
   Here's how `pyarrow.parquet` correctly propagates the Arrow schema within 
the Parquet metadata:
   
   ```py
   In [32]: pq.write_table(table, "test.parquet")
   
   In [33]: meta2 = pq.read_metadata('test.parquet')
   
   In [34]: meta2.metadata
   Out[34]: {b'ARROW:schema': 
b'/////6gAAAAQAAAAAAAKAAwABgAFAAgACgAAAAABBAAMAAAACAAIAAAABAAIAAAABAAAAAEAAAAEAAAAzP///wAAARAUAAAAIAAAAAQAAAABAAAALAAAAAUAAABhcnJheQAGAAgABAAGAAAAAgAAABAAFAAIAAYABwAMAAAAEAAQAAAAAAABAxAAAAAcAAAABAAAAAAAAAAEAAAAaXRlbQAABgAIAAYABgAAAAAAAQA='}
   ```
   
   However there's no embedded Arrow schema in the Parquet file written by 
DataFusion:
   
   ```
   In [35]: df_table.write_parquet(FILENAME)
   
   In [36]: meta = pq.read_metadata(FILENAME)
   
   In [37]: meta.metadata # None
   ```


-- 
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: github-unsubscr...@datafusion.apache.org

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


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

Reply via email to