You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/08/10 18:39:42 UTC

[GitHub] [iceberg] samarthjain opened a new issue #1315: [python-iceberg] Scan plan files not working correctly when filters are present

samarthjain opened a new issue #1315:
URL: https://github.com/apache/iceberg/issues/1315


   For example - for an iceberg table partitioned by dateint, the following call returns all the files in the current snapshot as opposed to returning only those files that have `dateint=20200805` 
   
   ```
   Scan scan = scan.filter("dateint=20200805");
   for task in scan.plan_files():
     print(task.file.path()) // This prints paths for all the files
   ```
   
   To workaround this, I had to directly create the `DataTableScan` object passing in the filter. 
   ```
   scan = DataTableScan(
                           ops=tbl.ops,
                           table=tbl,
                           schema=None,
                           snapshot_id=tbl.current_snapshot(),
                           row_filter=Expressions.convert_string_to_expr("dateint=20200805"),
                       )
   
   for task in scan.plan_files(tbl.ops, tbl.current_snapshot()):
     print (task.file.path()) // this prints only the files that belong to partition `dateint=20200805`
   ```
   


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

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



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