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/25 17:04:16 UTC
[GitHub] [incubator-iceberg] rdblue commented on a change in pull request
#123: Add support for struct field based filtering
rdblue 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_r268751705
##########
File path: api/src/main/java/org/apache/iceberg/expressions/UnboundPredicate.java
##########
@@ -67,29 +68,25 @@ Expression bind(Types.StructType struct) {
* @throws ValidationException if literals do not match bound references, or if comparison on expression is invalid
*/
public Expression bind(Types.StructType struct, boolean caseSensitive) {
- Types.NestedField field;
- String expressionFieldPath = ref().name();
- boolean isNestedFieldExp = expressionFieldPath.indexOf('.') > -1;
-
- field = isNestedFieldExp ? findNestedField(struct, expressionFieldPath, caseSensitive) :
- caseSensitive ? struct.field(expressionFieldPath) : struct.caseInsensitiveField(ref().name());
+ Schema schema = new Schema(struct.fields());
+ Types.NestedField field = schema.findField(caseSensitive? ref().name(): ref().name().toLowerCase());
Review comment:
This should probably use a case insensitive version of `findField` instead of assuming that passing lower-case in will work.
----------------------------------------------------------------
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