@Override protected Tuple wrapKeyValueAsResult(Cell keyValue) throws SQLException { return new SingleKeyValueTuple(keyValue); }
@Override public boolean filterRow() { // If column was found, return false if it was matched, true if it was not. if (foundColumn()) { return !this.matchedColumn; } // If column was not found, evaluate the expression here upon completion. // This is required with certain expressions, for example, with IS NULL // expressions where they'll evaluate to TRUE when the column being // tested wasn't found. // Since the filter is called also to position the scan initially, we have // to guard against this by checking whether or not we've filtered in // the key value (i.e. filterKeyValue was called and we found the keyValue // for which we're looking). if (inputTuple.hasKey() && expression.requiresFinalEvaluation()) { return !Boolean.TRUE.equals(evaluate(inputTuple)); } // Finally, if we have no values, and we're not required to re-evaluate it // just filter the row return true; }
@Override public void reset() { inputTuple.reset(); matchedColumn = false; super.reset(); }
@Override public ReturnCode filterKeyValue(Cell keyValue) { if (this.matchedColumn) { // We already found and matched the single column, all keys now pass return ReturnCode.INCLUDE_AND_NEXT_COL; } if (this.foundColumn()) { // We found all the columns, but did not match the expression, so skip to next row return ReturnCode.NEXT_ROW; } if (compare(keyValue.getFamilyArray(), keyValue.getFamilyOffset(), keyValue.getFamilyLength(), keyValue.getQualifierArray(), keyValue.getQualifierOffset(), keyValue.getQualifierLength()) != 0) { // Remember the key in case this is the only key value we see. // We'll need it if we have row key columns too. inputTuple.setKey(keyValue); // This is a key value we're not interested in return ReturnCode.INCLUDE_AND_NEXT_COL; } inputTuple.setCell(keyValue); // We have the columns, so evaluate here if (!Boolean.TRUE.equals(evaluate(inputTuple))) { return ReturnCode.NEXT_ROW; } this.matchedColumn = true; return ReturnCode.INCLUDE_AND_NEXT_COL; }
public void setCell(Cell cell) { if (cell == null) { throw new IllegalArgumentException(); } this.cell = cell; setKey(cell); }
public SingleKeyValueTuple(Cell cell) { if (cell == null) { throw new NullPointerException(); } setCell(cell); }
private boolean foundColumn() { return inputTuple.size() > 0; }
@Override public ReturnCode filterKeyValue(Cell keyValue) { if (this.matchedColumn) { // We already found and matched the single column, all keys now pass return ReturnCode.INCLUDE_AND_NEXT_COL; } if (this.foundColumn()) { // We found all the columns, but did not match the expression, so skip to next row return ReturnCode.NEXT_ROW; } if (compare(keyValue.getFamilyArray(), keyValue.getFamilyOffset(), keyValue.getFamilyLength(), keyValue.getQualifierArray(), keyValue.getQualifierOffset(), keyValue.getQualifierLength()) != 0) { // Remember the key in case this is the only key value we see. // We'll need it if we have row key columns too. inputTuple.setKey(keyValue); // This is a key value we're not interested in return ReturnCode.INCLUDE_AND_NEXT_COL; } inputTuple.setCell(keyValue); // We have the columns, so evaluate here if (!Boolean.TRUE.equals(evaluate(inputTuple))) { return ReturnCode.NEXT_ROW; } this.matchedColumn = true; return ReturnCode.INCLUDE_AND_NEXT_COL; }
public void setCell(Cell cell) { if (cell == null) { throw new IllegalArgumentException(); } this.cell = cell; setKey(cell); }
public SingleKeyValueTuple(Cell cell) { if (cell == null) { throw new NullPointerException(); } setCell(cell); }
private boolean foundColumn() { return inputTuple.size() > 0; }
public LiteralResultIterationPlan(StatementContext context, FilterableStatement statement, TableRef tableRef, RowProjector projection, Integer limit, Integer offset, OrderBy orderBy, ParallelIteratorFactory parallelIteratorFactory) throws SQLException { this(Collections.<Tuple> singletonList(new SingleKeyValueTuple(KeyValue.LOWESTKEY)), context, statement, tableRef, projection, limit, offset, orderBy, parallelIteratorFactory); }
@Override public ReturnCode filterKeyValue(Cell keyValue) { if (this.matchedColumn) { // We already found and matched the single column, all keys now pass return ReturnCode.INCLUDE_AND_NEXT_COL; } if (this.foundColumn()) { // We found all the columns, but did not match the expression, so skip to next row return ReturnCode.NEXT_ROW; } if (compare(keyValue.getFamilyArray(), keyValue.getFamilyOffset(), keyValue.getFamilyLength(), keyValue.getQualifierArray(), keyValue.getQualifierOffset(), keyValue.getQualifierLength()) != 0) { // Remember the key in case this is the only key value we see. // We'll need it if we have row key columns too. inputTuple.setKey(keyValue); // This is a key value we're not interested in return ReturnCode.INCLUDE_AND_NEXT_COL; } inputTuple.setCell(keyValue); // We have the columns, so evaluate here if (!Boolean.TRUE.equals(evaluate(inputTuple))) { return ReturnCode.NEXT_ROW; } this.matchedColumn = true; return ReturnCode.INCLUDE_AND_NEXT_COL; }
public void setCell(Cell cell) { if (cell == null) { throw new IllegalArgumentException(); } this.cell = cell; setKey(cell); }
@Override public void reset() { inputTuple.reset(); matchedColumn = false; super.reset(); }
public SingleKeyValueTuple(Cell cell) { if (cell == null) { throw new NullPointerException(); } setCell(cell); }
private boolean foundColumn() { return inputTuple.size() > 0; }
@Override public boolean filterRow() { // If column was found, return false if it was matched, true if it was not. if (foundColumn()) { return !this.matchedColumn; } // If column was not found, evaluate the expression here upon completion. // This is required with certain expressions, for example, with IS NULL // expressions where they'll evaluate to TRUE when the column being // tested wasn't found. // Since the filter is called also to position the scan initially, we have // to guard against this by checking whether or not we've filtered in // the key value (i.e. filterKeyValue was called and we found the keyValue // for which we're looking). if (inputTuple.hasKey() && expression.requiresFinalEvaluation()) { return !Boolean.TRUE.equals(evaluate(inputTuple)); } // Finally, if we have no values, and we're not required to re-evaluate it // just filter the row return true; }
new SingleKeyValueTuple(dest.getValue(0))); ProjectedValueTuple merged = TupleProjector.mergeProjectedValue( first, destSchema, destBitSet, src, srcSchema,
@Override public void reset() { inputTuple.reset(); matchedColumn = false; super.reset(); }