Fokko commented on PR #829:
URL: https://github.com/apache/iceberg-python/pull/829#issuecomment-2219874876

   > Can you talk a bit more about "re-aligning"? 
   
   Let me give two examples:
   
   ### Out of order
   
   ```
   table {
     1: str foo
     2: int bar
   }
   ```
   
   It is fine to write a parquet file to this table with:
   
   ```
   table {
     2: int bar
     1: str foo
   }
   ```
   
   When the table is being read, the columns are re-ordered by 
`to_requested_schema`.
   
   The same goes for casting:
   
   ```
   table {
     1: str foo
     2: long bar
   }
   ```
   
   It is fine to write:
   
   ```
   ```
   table {
     1: str foo
     2: int bar
   }
   ```
   
   The upcasting to a long will be done when the data is being read, but it is 
less efficient since we first let Arrow read the data as an int, and then it 
will do the cast to long in `to_requested_schema` to be able to append the 
files.


-- 
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