owencwl opened a new issue #3068:
URL: https://github.com/apache/iceberg/issues/3068


     Why is the filter condition not effective??????and print out all the data 
in the table.
   I use hivecatalog and the file format is parquet.
   Example code:
   
   
   public static void main(String[] args) throws IOException {
       String lakeSpaceName = "default";
       String lakeTableName = "t";
   
       TableIdentifier tableIdent = TableIdentifier.of(lakeSpaceName, 
lakeTableName);
       CatalogLoader hiveloader = CatalogLoader.hive(lakeSpaceName, hiveConf, 
Maps.newHashMap());
       TableLoader tableLoader = TableLoader.fromCatalog(hiveloader, 
tableIdent);
       List<RowData> results =  
readRowData(FlinkSource.forRowData().tableLoader(tableLoader)
           .filters(Collections.singletonList(Expressions.equal("dt", 
"2020-03-29"))).buildFormat(),null);
       results.forEach(System.out::println);
     }
   
     public static List<RowData> readRowData(FlinkInputFormat inputFormat, 
RowType rowType)
         throws IOException {
       FlinkInputSplit[] splits = inputFormat.createInputSplits(0);
       List<RowData> results = Lists.newArrayList();
       for (FlinkInputSplit s : splits) {
         inputFormat.open(s);
         while (!inputFormat.reachedEnd()) {
           RowData row = inputFormat.nextRecord(null);
           results.add(row);
         }
       }
       inputFormat.close();
   
       return results;
     }


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