Fokko commented on issue #8551:
URL: https://github.com/apache/iceberg/issues/8551#issuecomment-1715450270
@grobgl That is correct. Currently, we stick to the order of fields of the
table schema itself.
```
Python 3.9.18 (main, Aug 24 2023, 21:19:58)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.14.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from pyiceberg.catalog import load_catalog
...:
In [2]: cat = load_catalog("local")
In [3]: tbl = cat.load_table("nyc.taxis")
In [4]: tbl.scan().to_pandas()
Out[4]:
VendorID tpep_pickup_datetime tpep_dropoff_datetime
passenger_count ... improvement_surcharge total_amount congestion_surcharge
airport_fee
0 2 2003-01-05 23:37:05+00:00 2003-01-06 21:02:39+00:00
1.0 ... 0.0 0.00 0.0
0.00
1 2 2009-01-01 00:35:26+00:00 2009-01-01 00:52:52+00:00
1.0 ... 0.3 15.30 2.5
0.00
2 2 2009-01-01 00:34:48+00:00 2009-01-01 22:29:18+00:00
1.0 ... 0.3 72.72 0.0
1.25
3 2 2009-01-01 00:04:40+00:00 2009-01-01 00:18:40+00:00
1.0 ... 0.3 13.80 2.5
0.00
4 2 2009-01-01 00:08:33+00:00 2009-01-01 00:14:48+00:00
1.0 ... 0.3 10.30 2.5
0.00
... ... ... ...
... ... ... ... ...
...
15885528 2 2022-05-03 08:26:41+00:00 2022-05-03 08:35:54+00:00
1.0 ... 0.3 15.36 2.5
0.00
15885529 2 2022-05-03 08:40:25+00:00 2022-05-03 08:50:11+00:00
1.0 ... 0.3 13.80 2.5
0.00
15885530 2 2022-05-03 08:56:56+00:00 2022-05-03 09:11:19+00:00
1.0 ... 0.3 15.80 2.5
0.00
15885531 2 2022-05-03 09:17:10+00:00 2022-05-03 09:33:03+00:00
1.0 ... 0.3 15.30 2.5
0.00
15885532 2 2022-05-03 09:36:16+00:00 2022-05-03 09:44:01+00:00
1.0 ... 0.3 11.54 2.5
0.00
[15885533 rows x 19 columns]
In [5]: tbl.scan(selected_fields=('VendorID', 'tpep_dropoff_datetime',
'tpep_pickup_datetime')).to_pandas()
Out[5]:
VendorID tpep_pickup_datetime tpep_dropoff_datetime
0 2 2003-01-05 23:37:05+00:00 2003-01-06 21:02:39+00:00
1 2 2009-01-01 00:35:26+00:00 2009-01-01 00:52:52+00:00
2 2 2009-01-01 00:34:48+00:00 2009-01-01 22:29:18+00:00
3 2 2009-01-01 00:04:40+00:00 2009-01-01 00:18:40+00:00
4 2 2009-01-01 00:08:33+00:00 2009-01-01 00:14:48+00:00
... ... ... ...
15885528 2 2022-05-03 08:26:41+00:00 2022-05-03 08:35:54+00:00
15885529 2 2022-05-03 08:40:25+00:00 2022-05-03 08:50:11+00:00
15885530 2 2022-05-03 08:56:56+00:00 2022-05-03 09:11:19+00:00
15885531 2 2022-05-03 09:17:10+00:00 2022-05-03 09:33:03+00:00
15885532 2 2022-05-03 09:36:16+00:00 2022-05-03 09:44:01+00:00
[15885533 rows x 3 columns]
```
I can see how this is counter intuitive. @rdblue WDYT?
--
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]