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 2019/03/11 15:33:35 UTC

[GitHub] [incubator-iceberg] rominparekh commented on a change in pull request #123: Add support for struct field based filtering

rominparekh commented on a change in pull request #123: Add support for struct field based filtering
URL: https://github.com/apache/incubator-iceberg/pull/123#discussion_r264283712
 
 

 ##########
 File path: api/src/main/java/com/netflix/iceberg/expressions/UnboundPredicate.java
 ##########
 @@ -67,11 +68,12 @@ Expression bind(Types.StructType struct) {
    */
   public Expression bind(Types.StructType struct, boolean caseSensitive) {
     Types.NestedField field;
-    if (caseSensitive) {
-      field = struct.field(ref().name());
-    } else {
-      field = struct.caseInsensitiveField(ref().name());
-    }
+    String expressionFieldPath = ref().name();
+
+    boolean isNestedFieldExp = expressionFieldPath.indexOf('.') > -1;
+
+    field = isNestedFieldExp ? findNestedField(struct, expressionFieldPath, caseSensitive) :
+      caseSensitive ? struct.field(ref().name()) : struct.caseInsensitiveField(ref().name());
 
 Review comment:
   minor: can we reuse `expressionFieldPath` instead of obtaining `ref().name()` again? 

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


With regards,
Apache Git Services

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