throw new IllegalStateException("Error FilterOperatorEnum: " + op.getValue());
public ColumnRange(TblColRef column, Set<ByteArray> values, TupleFilter.FilterOperatorEnum op) { this.column = column; //TODO: the treatment is un-precise if (op == TupleFilter.FilterOperatorEnum.EQ || op == TupleFilter.FilterOperatorEnum.IN || op == TupleFilter.FilterOperatorEnum.LTE || op == TupleFilter.FilterOperatorEnum.GTE) { isBoundryInclusive = true; } switch (op) { case EQ: case IN: valueSet = new HashSet<ByteArray>(values); refreshBeginEndFromEquals(); break; case LT: case LTE: end = rangeEndComparator.comparator.max(values); break; case GT: case GTE: begin = rangeStartComparator.comparator.min(values); break; case NEQ: case NOTIN: case ISNULL: case ISNOTNULL: // let Optiq filter it! break; default: throw new UnsupportedOperationException(op.name()); } }
@Override public int hashCode() { int result = operator != null ? operator.hashCode() : 0; result = 31 * result + (column != null ? column.hashCode() : 0); result = 31 * result + (function != null ? function.hashCode() : 0); result = 31 * result + (secondColumn != null ? secondColumn.hashCode() : 0); result = 31 * result + (conditionValues != null ? conditionValues.hashCode() : 0); result = 31 * result + (firstCondValue != null ? firstCondValue.hashCode() : 0); result = 31 * result + (dynamicVariables != null ? dynamicVariables.hashCode() : 0); return result; } }
throw new IllegalStateException("Error FilterOperatorEnum: " + op.getValue());
break; default: throw new IllegalStateException("Error FilterOperatorEnum: " + op.getValue());
public ColumnRange(TblColRef column, Set<ByteArray> values, TupleFilter.FilterOperatorEnum op) { this.column = column; //TODO: the treatment is un-precise if (op == TupleFilter.FilterOperatorEnum.EQ || op == TupleFilter.FilterOperatorEnum.IN || op == TupleFilter.FilterOperatorEnum.LTE || op == TupleFilter.FilterOperatorEnum.GTE) { isBoundryInclusive = true; } switch (op) { case EQ: case IN: valueSet = new HashSet<ByteArray>(values); refreshBeginEndFromEquals(); break; case LT: case LTE: end = rangeEndComparator.comparator.max(values); break; case GT: case GTE: begin = rangeStartComparator.comparator.min(values); break; case NEQ: case NOTIN: case ISNULL: case ISNOTNULL: // let Optiq filter it! break; default: throw new UnsupportedOperationException(op.name()); } }
@Override public int hashCode() { int result = operator != null ? operator.hashCode() : 0; result = 31 * result + (column != null ? column.hashCode() : 0); result = 31 * result + (function != null ? function.hashCode() : 0); result = 31 * result + (secondColumn != null ? secondColumn.hashCode() : 0); result = 31 * result + (conditionValues != null ? conditionValues.hashCode() : 0); result = 31 * result + (firstCondValue != null ? firstCondValue.hashCode() : 0); result = 31 * result + (dynamicVariables != null ? dynamicVariables.hashCode() : 0); return result; } }
@Override public int hashCode() { return (operator == null ? 0 : operator.hashCode()) + 31 * this.children.hashCode(); } }
private static void serializeFilter(int flag, TupleFilter filter, ByteBuffer buffer, IFilterCodeSystem<?> cs) { if (flag < 0) { BytesUtil.writeVInt(-1, buffer); } else { int opVal = filter.getOperator().getValue(); BytesUtil.writeVInt(opVal, buffer); filter.serialize(cs, buffer); BytesUtil.writeVInt(flag, buffer); } }
private static void serializeFilter(int flag, TupleFilter filter, Decorator decorator, ByteBuffer buffer) { if (flag < 0) { BytesUtil.writeVInt(-1, buffer); } else { byte[] bytes = filter.serialize(); int opVal = filter.getOperator().getValue(); BytesUtil.writeVInt(opVal, buffer); BytesUtil.writeByteArray(bytes, buffer); BytesUtil.writeVInt(flag, buffer); } }
break; default: throw new IllegalStateException("Error FilterOperatorEnum: " + op.getValue());
public ColumnValueRange(TblColRef column, Collection<String> values, FilterOperatorEnum op) { this.column = column; this.order = RowKeyColumnOrder.getInstance(column.getType()); switch (op) { case EQ: case IN: equalValues = new HashSet<String>(values); refreshBeginEndFromEquals(); break; case LT: case LTE: endValue = order.max(values); break; case GT: case GTE: beginValue = order.min(values); break; case NEQ: case NOTIN: case ISNULL: // TODO ISNULL worth pass down as a special equal value case ISNOTNULL: // let Optiq filter it! break; default: throw new UnsupportedOperationException(op.name()); } }
private static void serializeFilter(int flag, TupleFilter filter, Decorator decorator, ByteBuffer buffer) { if (flag < 0) { BytesUtil.writeVInt(-1, buffer); } else { byte[] bytes = filter.serialize(); int opVal = filter.getOperator().getValue(); BytesUtil.writeVInt(opVal, buffer); BytesUtil.writeByteArray(bytes, buffer); BytesUtil.writeVInt(flag, buffer); } }
private static void serializeFilter(int flag, TupleFilter filter, ByteBuffer buffer, IFilterCodeSystem<?> cs) { if (flag < 0) { BytesUtil.writeVInt(-1, buffer); } else { int opVal = filter.getOperator().getValue(); BytesUtil.writeVInt(opVal, buffer); filter.serialize(cs, buffer); BytesUtil.writeVInt(flag, buffer); } }
@Override public int hashCode() { return (operator == null ? 0 : operator.hashCode()) + 31 * this.children.hashCode(); } }