/** * IS FALSE predicate. */ private static LogicalExpression createIsFalsePredicate(LogicalExpression expr) { return new ParquetIsPredicate<Boolean>(expr, (exprStat, evaluator) -> { if (isAllNulls(exprStat, evaluator.getRowCount())) { return RowsMatch.NONE; } if (!exprStat.hasNonNullValue()) { return RowsMatch.SOME; } if (((BooleanStatistics) exprStat).getMin()) { return RowsMatch.NONE; } return ((BooleanStatistics) exprStat).getMax() ? RowsMatch.SOME : checkNull(exprStat); }); }
/** * IS NOT FALSE predicate. */ private static LogicalExpression createIsNotFalsePredicate(LogicalExpression expr) { return new ParquetIsPredicate<Boolean>(expr, (exprStat, evaluator) -> { if (isAllNulls(exprStat, evaluator.getRowCount())) { return RowsMatch.ALL; } if (!exprStat.hasNonNullValue()) { return RowsMatch.SOME; } if (!((BooleanStatistics) exprStat).getMax()) { return hasNoNulls(exprStat) ? RowsMatch.NONE : RowsMatch.SOME; } return ((BooleanStatistics) exprStat).getMin() ? RowsMatch.ALL : RowsMatch.SOME; }); }
/** * IS TRUE predicate. */ private static LogicalExpression createIsTruePredicate(LogicalExpression expr) { return new ParquetIsPredicate<Boolean>(expr, (exprStat, evaluator) -> { if (isAllNulls(exprStat, evaluator.getRowCount())) { return RowsMatch.NONE; } if (!exprStat.hasNonNullValue()) { return RowsMatch.SOME; } if (!((BooleanStatistics) exprStat).getMax()) { return RowsMatch.NONE; } return ((BooleanStatistics) exprStat).getMin() ? checkNull(exprStat) : RowsMatch.SOME; }); }
/** * IS NOT TRUE predicate. */ private static LogicalExpression createIsNotTruePredicate(LogicalExpression expr) { return new ParquetIsPredicate<Boolean>(expr, (exprStat, evaluator) -> { if (isAllNulls(exprStat, evaluator.getRowCount())) { return RowsMatch.ALL; } if (!exprStat.hasNonNullValue()) { return RowsMatch.SOME; } if (((BooleanStatistics) exprStat).getMin()) { return hasNoNulls(exprStat) ? RowsMatch.NONE : RowsMatch.SOME; } return ((BooleanStatistics) exprStat).getMax() ? RowsMatch.SOME : RowsMatch.ALL; }); }
BooleanStatistics booleanStatistics = (BooleanStatistics) statistics; boolean hasTrueValues = !(booleanStatistics.getMax() == false && booleanStatistics.getMin() == false); boolean hasFalseValues = !(booleanStatistics.getMax() == true && booleanStatistics.getMin() == true); if (hasTrueValues && hasFalseValues) { return Domain.all(type);
BooleanStatistics booleanStatistics = (BooleanStatistics) statistics; boolean hasTrueValues = !(booleanStatistics.getMax() == false && booleanStatistics.getMin() == false); boolean hasFalseValues = !(booleanStatistics.getMax() == true && booleanStatistics.getMin() == true); if (hasTrueValues && hasFalseValues) { return Domain.all(type);