if (column.equals(ROW_KEY_PATH)) { MaterializedField field = MaterializedField.create(column.getAsNamePart().getName(), ROW_KEY_TYPE); rowKeyVector = outputMutator.addField(field, VarBinaryVector.class);
/** * Verify the presence of a column family in the schema path of the hbase table or whether the schema path is * the row key column. * * @param columns List of the selected columns * @param hTableDesc HTableDescriptor of HBase/MapR-DB_binary table (consists the details about that table) * @throws DrillRuntimeException if column family does not exist, or is not row_key column. */ public static void verifyColumns(List<SchemaPath> columns, HTableDescriptor hTableDesc) { if (Utilities.isStarQuery(columns)) { return; } for (SchemaPath column : columns) { if (!(column.equals(DrillHBaseConstants.ROW_KEY_PATH) || hTableDesc.hasFamily(HBaseUtils.getBytes(column.getRootSegment().getPath())))) { DrillRuntimeException.format("The column family '%s' does not exist in HBase table: %s .", column.getRootSegment().getPath(), hTableDesc.getNameAsString()); } } }
@Override public Boolean visitSchemaPath(SchemaPath path, LogicalExpression value) throws RuntimeException { if (!(value instanceof SchemaPath)) { return false; } return path.equals(value); }
@Override public boolean apply(@Nullable SchemaPath path) { return path.equals(COLUMNS); } }).isPresent();
@Override public boolean apply(@Nullable SchemaPath path) { return path.equals(RepeatedVarCharOutput.COLUMNS); } }).isPresent();
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Key other = (Key) obj; return this.name.equals(other.name); }
@Override public boolean apply(SchemaPath path) { return Preconditions.checkNotNull(path).equals(SchemaPath.STAR_COLUMN); } }).isPresent();
/** * Create "dummy" fields for columns which are selected in the SELECT clause, but not * present in the Parquet schema. * @param output the output container * @throws SchemaChangeException should not occur */ public void createNonExistentColumns(OutputMutator output, List<NullableIntVector> nullFilledVectors) throws SchemaChangeException { List<SchemaPath> projectedColumns = Lists.newArrayList(selectedCols); for (int i = 0; i < columnsFound.length; i++) { SchemaPath col = projectedColumns.get(i); assert col != null; if ( ! columnsFound[i] && ! col.equals(SchemaPath.STAR_COLUMN)) { nullFilledVectors.add(createMissingColumn(col, output)); } } }
protected boolean checkRowKey(List<SchemaPath> columns) { for (SchemaPath s : columns) { if (s.equals(((DbGroupScan)IndexPlanUtils.getGroupScan(origScan)).getRowKeyPath())) { return true; } } return false; }
if (column.equals(ROW_KEY_PATH)) { MaterializedField field = MaterializedField.create(column.getAsNamePart().getName(), ROW_KEY_TYPE); rowKeyVector = outputMutator.addField(field, VarBinaryVector.class);
/** * Verify the presence of a column family in the schema path of the hbase table or whether the schema path is * the row key column. * * @param columns List of the selected columns * @param hTableDesc HTableDescriptor of HBase/MapR-DB_binary table (consists the details about that table) * @throws DrillRuntimeException if column family does not exist, or is not row_key column. */ public static void verifyColumns(List<SchemaPath> columns, HTableDescriptor hTableDesc) { if (Utilities.isStarQuery(columns)) { return; } for (SchemaPath column : columns) { if (!(column.equals(DrillHBaseConstants.ROW_KEY_PATH) || hTableDesc.hasFamily(HBaseUtils.getBytes(column.getRootSegment().getPath())))) { DrillRuntimeException.format("The column family '%s' does not exist in HBase table: %s .", column.getRootSegment().getPath(), hTableDesc.getNameAsString()); } } }