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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]