@Override public Boolean visitSchemaPath(SchemaPath path, LogicalExpression valueArg) throws RuntimeException { this.path = path.getRootSegmentPath();
final String partitionCol = partitionColMapping.get(colName.getRootSegmentPath()); if (partitionCol != null) { nativeScanCols.add(SchemaPath.getSimplePath(partitionCol));
boolean isRowKey = ((SchemaPath) nameArg).getRootSegmentPath().equals(DrillHBaseConstants.ROW_KEY); int offset = ((IntExpression) valueArg1).getInt();
@Override public void setup(OperatorContext context, OutputMutator output) throws ExecutionSetupException { this.output = output; this.context = context; try { KuduTable table = client.openTable(scanSpec.getTableName()); KuduScannerBuilder builder = client.newScannerBuilder(table); if (!isStarQuery()) { List<String> colNames = Lists.newArrayList(); for (SchemaPath p : this.getColumns()) { colNames.add(p.getRootSegmentPath()); } builder.setProjectedColumnNames(colNames); } context.getStats().startWait(); try { scanner = builder .lowerBoundRaw(scanSpec.getStartKey()) .exclusiveUpperBoundRaw(scanSpec.getEndKey()) .build(); } finally { context.getStats().stopWait(); } } catch (Exception e) { throw new ExecutionSetupException(e); } }
byte[] fieldValue = processor.getValue(); boolean sortOrderAscending = processor.isSortOrderAscending(); boolean isRowKey = field.getRootSegmentPath().equals(ROW_KEY); if (!(isRowKey || (!field.getRootSegment().isLastPath()
byte[] fieldValue = processor.getValue(); boolean sortOrderAscending = processor.isSortOrderAscending(); boolean isRowKey = field.getRootSegmentPath().equals(ROW_KEY); if (!(isRowKey || (!field.getRootSegment().isLastPath()
@Override public ExprNode visitSchemaPath(SchemaPath path, Void value) throws RuntimeException { String field = path.getRootSegmentPath().toUpperCase(); if (field.equals(CATS_COL_CATALOG_NAME) || field.equals(SCHS_COL_SCHEMA_NAME) || field.equals(SHRD_COL_TABLE_NAME) || field.equals(SHRD_COL_TABLE_SCHEMA) || field.equals(COLS_COL_COLUMN_NAME) || field.equals(FILES_COL_ROOT_SCHEMA_NAME) || field.equals(FILES_COL_WORKSPACE_NAME)) { return new FieldExprNode(field); } return visitUnknown(path, value); }
/** * If it is not star query, sorts out columns into three categories: * 1. table columns * 2. partition columns * 3. implicit file columns * If it is a star query, then only includes implicit columns that were * explicitly selected (e.g., SELECT *, FILENAME FROM ..) */ private void init() { for (SchemaPath column : columns) { final String path = column.getRootSegmentPath(); if (isStarQuery) { if (allImplicitColumns.get(path) != null) { selectedImplicitColumns.put(path, allImplicitColumns.get(path)); } } else { if (isPartitionColumn(partitionDesignator, path)) { selectedPartitionColumns.add(Integer.parseInt(path.substring(partitionDesignator.length()))); } else if (allImplicitColumns.get(path) != null) { selectedImplicitColumns.put(path, allImplicitColumns.get(path)); } else { tableColumns.add(column); } } } }
/** * Checks if given column is partition or not. * * @param optionManager options * @param column column * @return true if given column is partition, false otherwise */ public static boolean isPartitionColumn(OptionManager optionManager, SchemaPath column) { String partitionDesignator = optionManager.getString(ExecConstants.FILESYSTEM_PARTITION_COLUMN_LABEL); String path = column.getRootSegmentPath(); return isPartitionColumn(partitionDesignator, path); }
public static RelDataTypeField findField(String fieldName, RelDataType rowType) { final String rootPart = SchemaPath.parseFromString(fieldName).getRootSegmentPath(); for (RelDataTypeField f : rowType.getFieldList()) { if (rootPart.equalsIgnoreCase(f.getName())) { return f; } } return null; }
for (int i = 0; i < schemaPathStrings.length; i++) { SchemaPath schemaPath = encodedPathsItr.next(); if (schemaPath.getRootSegmentPath().startsWith(ENC_PREFIX)) { schemaPathStrings[i] = schemaPath.getRootSegmentPath(); } else { schemaPathStrings[i] = schemaPath.toExpr();
private List<NamedExpression> getExpressionList() { List<NamedExpression> exprs = Lists.newArrayList(); for (MaterializedField field : incoming.getSchema()) { String fieldName = field.getName(); if (fieldName.equals(popConfig.getColumn().getRootSegmentPath())) { continue; } exprs.add(new NamedExpression(SchemaPath.getSimplePath(fieldName), new FieldReference(fieldName))); } return exprs; }
if (indexContext.getLeftOutPathsInFunctions() != null) { for (LogicalExpression expr : indexContext.getLeftOutPathsInFunctions()) { leftOutFieldNames.add(((SchemaPath) expr).getRootSegmentPath()); fieldInFunctions.add(path.getRootSegmentPath()); SchemaPath.parseFromString(fieldName).getRootSegmentPath(), fields.size(), typeFactory.createSqlType(SqlTypeName.ANY))); new RelDataTypeFieldImpl(dollarPath.getRootSegmentPath(), fields.size(), origScan.getCluster().getTypeFactory().createSqlType(SqlTypeName.ANY)));
newPath.getRootSegmentPath(), fields.size(), typeFactory.createSqlType(SqlTypeName.ANY))); SchemaPath path = SchemaPath.parseFromString(f.getName()); rowfields.add(new RelDataTypeFieldImpl( path.getRootSegmentPath(), rowfields.size(), typeFactory.createMapType(typeFactory.createSqlType(SqlTypeName.VARCHAR), typeFactory.createSqlType(SqlTypeName.ANY))
boolean isRowKey = ((SchemaPath) nameArg).getRootSegmentPath().equals(DrillHBaseConstants.ROW_KEY); int offset = ((IntExpression) valueArg1).getInt();
byte[] fieldValue = processor.getValue(); boolean sortOrderAscending = processor.isSortOrderAscending(); boolean isRowKey = field.getRootSegmentPath().equals(ROW_KEY); if (!(isRowKey || (!field.getRootSegment().isLastPath()
byte[] fieldValue = processor.getValue(); boolean sortOrderAscending = processor.isSortOrderAscending(); boolean isRowKey = field.getRootSegmentPath().equals(ROW_KEY); if (!(isRowKey || (!field.getRootSegment().isLastPath()