Github user denalex commented on a diff in the pull request: https://github.com/apache/incubator-hawq/pull/906#discussion_r83044785 --- Diff: pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/HiveDataFragmenter.java --- @@ -405,24 +411,41 @@ private String buildFilterStringForHive() throws Exception { HiveFilterBuilder eval = new HiveFilterBuilder(inputData); Object filter = eval.getFilterObject(filterInput); - String prefix = ""; - - if (filter instanceof List) { - - for (Object f : (List<?>) filter) { - if (buildSingleFilter(f, filtersString, prefix)) { - // Set 'and' operator between each matched partition filter. - prefix = " and "; - } - } - + if (filter instanceof LogicalFilter) { + buildCompoundFilter((LogicalFilter) filter, filtersString); } else { - buildSingleFilter(filter, filtersString, prefix); + buildSingleFilter(filter, filtersString, ""); } return filtersString.toString(); } + private void buildCompoundFilter(LogicalFilter filter, StringBuilder filterString) throws Exception{ + String prefix; + switch(filter.getOperator()) { + case HDOP_AND: + prefix = " and "; + break; + case HDOP_OR: + prefix = " or "; + break; + case HDOP_NOT: + prefix = " not "; + break; + default: + prefix = ""; + } + + for (int i = 0; i < filter.getFilterList().size(); i++) { --- End diff -- for (Object f : filter.getFilterList() ) is more compact notation that collapses 2 lines into one
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---