YinZheng-Sun commented on code in PR #956:
URL: https://github.com/apache/iceberg-cpp/pull/956#discussion_r4292059771


##########
src/iceberg/parquet/parquet_reader.cc:
##########
@@ -313,6 +310,18 @@ class ParquetReader::Impl {
 
     // Project read schema onto the Parquet file schema
     ICEBERG_ASSIGN_OR_RAISE(projection_, BuildProjection(reader_.get(), 
*read_schema_));
+    if (options.filter &&
+        options.properties.Get(ReaderProperties::kParquetRowGroupFilter)) {
+      auto filter = options.filter;
+      ICEBERG_ASSIGN_OR_RAISE(auto is_bound, IsBoundVisitor::IsBound(filter));
+      if (!is_bound) {
+        ICEBERG_ASSIGN_OR_RAISE(
+            filter, Binder::Bind(*options.projection, filter, 
options.case_sensitive));

Review Comment:
   Thanks for the review. The first version of this PR bound against the table 
schema, and @wgtmac suggested switching to the read/projection schema to align 
with Java (see 
https://github.com/apache/iceberg-cpp/pull/956#discussion_r4095656469). In 
Java, `ReadConf` builds `ParquetMetricsRowGroupFilter(expectedSchema, filter, 
caseSensitive)`, and the scan projection already includes the filter columns 
via `Binder.boundReferences()`.
   



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