@Override public int findColumn(String colName) throws SQLException { return getSchema().getColumnIdByName(colName); }
@Override public int findColumn(String colName) throws SQLException { return getSchema().getColumnIdByName(colName); }
private void prepareProjection(Column[] targets) { projectionMap = new Integer[targets.length]; int tid; for (int i = 0; i < targets.length; i++) { tid = schema.getColumnIdByName(targets[i].getSimpleName()); projectionMap[i] = tid; } ArrayList<Integer> projectionIdList = new ArrayList<Integer>(TUtil.newList(projectionMap)); ColumnProjectionUtils.setReadColumnIDs(conf, projectionIdList); }
@Override public EvalNode bind(EvalContext evalContext, Schema schema) { super.bind(evalContext, schema); // TODO - column namespace should be improved to simplify name handling and resolving. if (column.hasQualifier()) { fieldId = schema.getColumnId(column.getQualifiedName()); } else { fieldId = schema.getColumnIdByName(column.getSimpleName()); } if (fieldId == -1) { throw new IllegalStateException("No Such Column Reference: " + column + ", schema: " + schema); } return this; }
@Override public EvalNode bind(EvalContext evalContext, Schema schema) { super.bind(evalContext, schema); // TODO - column namespace should be improved to simplify name handling and resolving. fieldId = schema.getColumnId(field.name().interned()); if (fieldId == -1) { // fallback fieldId = schema.getColumnIdByName(field.name().interned()); } if (fieldId == -1) { throw new IllegalStateException("No Such Column Reference: " + field + ", schema: " + schema); } return this; }
return null; int columnId = partitionColumnSchema.getColumnIdByName(parts[0]); Column keyColumn = partitionColumnSchema.getColumn(columnId); String pathName = StringUtils.unescapePathName(parts[1]);
return null; int columnId = partitionColumnSchema.getColumnIdByName(parts[0]); Column keyColumn = partitionColumnSchema.getColumn(columnId); String pathName = StringUtils.unescapePathName(parts[1]);
keyIndex = inSchema.getColumnId(col.getQualifiedName()); } else { keyIndex = inSchema.getColumnIdByName(col.getSimpleName()); keyIndex = inSchema.getColumnId(col.getQualifiedName()); } else { keyIndex = inSchema.getColumnIdByName(col.getSimpleName());
/** * @param schema The schema of input tuples * @param sortKeys The description of sort keys */ public TupleComparator(Schema schema, SortSpec[] sortKeys) { Preconditions.checkArgument(sortKeys.length > 0, "At least one sort key must be specified."); this.sortKeyIds = new int[sortKeys.length]; this.asc = new boolean[sortKeys.length]; this.nullFirsts = new boolean[sortKeys.length]; for (int i = 0; i < sortKeys.length; i++) { if (sortKeys[i].getSortKey().hasQualifier()) { this.sortKeyIds[i] = schema.getColumnId(sortKeys[i].getSortKey().getQualifiedName()); } else { this.sortKeyIds[i] = schema.getColumnIdByName(sortKeys[i].getSortKey().getSimpleName()); } this.asc[i] = sortKeys[i].isAscending(); this.nullFirsts[i]= sortKeys[i].isNullFirst(); } }
/** * @param schema The schema of input tuples * @param sortKeys The description of sort keys */ public BaseTupleComparator(Schema schema, SortSpec[] sortKeys) { Preconditions.checkArgument(sortKeys.length > 0, "At least one sort key must be specified."); this.schema = schema; this.sortSpecs = sortKeys; this.sortKeyIds = new int[sortKeys.length]; this.asc = new boolean[sortKeys.length]; this.nullFirsts = new boolean[sortKeys.length]; for (int i = 0; i < sortKeys.length; i++) { if (sortKeys[i].getSortKey().hasQualifier()) { this.sortKeyIds[i] = schema.getColumnId(sortKeys[i].getSortKey().getQualifiedName()); } else { this.sortKeyIds[i] = schema.getColumnIdByName(sortKeys[i].getSortKey().getSimpleName()); } this.asc[i] = sortKeys[i].isAscending(); this.nullFirsts[i]= sortKeys[i].isNullsFirst(); } }
/** * @param schema The schema of input tuples * @param sortKeys The description of sort keys */ public BaseTupleComparator(Schema schema, SortSpec[] sortKeys) { Preconditions.checkArgument(sortKeys.length > 0, "At least one sort key must be specified."); this.schema = schema; this.sortSpecs = sortKeys; this.sortKeyIds = new int[sortKeys.length]; this.asc = new boolean[sortKeys.length]; this.nullFirsts = new boolean[sortKeys.length]; for (int i = 0; i < sortKeys.length; i++) { if (sortKeys[i].getSortKey().hasQualifier()) { this.sortKeyIds[i] = schema.getColumnId(sortKeys[i].getSortKey().getQualifiedName()); } else { this.sortKeyIds[i] = schema.getColumnIdByName(sortKeys[i].getSortKey().getSimpleName()); } this.asc[i] = sortKeys[i].isAscending(); this.nullFirsts[i]= sortKeys[i].isNullsFirst(); } }
keyIndex = inSchema.getColumnId(col.getQualifiedName()); } else { keyIndex = inSchema.getColumnIdByName(col.getSimpleName()); keyIndex = inSchema.getColumnId(col.getQualifiedName()); } else { keyIndex = inSchema.getColumnIdByName(col.getSimpleName());
public SortAggregateExec(TaskAttemptContext context, GroupbyNode plan, PhysicalExec child) throws IOException { super(context, plan, child); contexts = new FunctionContext[plan.getAggFunctions() == null ? 0 : plan.getAggFunctions().size()]; final Column [] keyColumns = plan.getGroupingColumns(); groupingKeyIds = new int[groupingKeyNum]; Column col; for (int idx = 0; idx < plan.getGroupingColumns().length; idx++) { col = keyColumns[idx]; if (col.hasQualifier()) { groupingKeyIds[idx] = inSchema.getColumnId(col.getQualifiedName()); } else { groupingKeyIds[idx] = inSchema.getColumnIdByName(col.getSimpleName()); } } currentKey = new VTuple(groupingKeyNum); outTuple = new VTuple(outSchema.size()); }
/** * @param schema The schema of input tuples * @param sortKeys The description of sort keys */ public UnSafeComparator(Schema schema, SortSpec[] sortKeys) { Preconditions.checkArgument(sortKeys.length > 0, "At least one sort key must be specified."); this.sortKeyIds = new int[sortKeys.length]; this.sortKeyTypes = new TajoDataTypes.Type[sortKeys.length]; this.asc = new boolean[sortKeys.length]; this.nullFirsts = new boolean[sortKeys.length]; for (int i = 0; i < sortKeys.length; i++) { if (sortKeys[i].getSortKey().hasQualifier()) { this.sortKeyIds[i] = schema.getColumnId(sortKeys[i].getSortKey().getQualifiedName()); } else { this.sortKeyIds[i] = schema.getColumnIdByName(sortKeys[i].getSortKey().getSimpleName()); } this.asc[i] = sortKeys[i].isAscending(); this.nullFirsts[i] = sortKeys[i].isNullsFirst(); this.sortKeyTypes[i] = sortKeys[i].getSortKey().getDataType().getType(); } }
/** * @param schema The schema of input tuples * @param sortKeys The description of sort keys */ public PrimitiveComparator(Schema schema, SortSpec[] sortKeys) { Preconditions.checkArgument(sortKeys.length > 0, "At least one sort key must be specified."); this.sortKeyIds = new int[sortKeys.length]; this.sortKeyTypes = new TajoDataTypes.Type[sortKeys.length]; this.asc = new boolean[sortKeys.length]; this.nullFirsts = new boolean[sortKeys.length]; for (int i = 0; i < sortKeys.length; i++) { if (sortKeys[i].getSortKey().hasQualifier()) { this.sortKeyIds[i] = schema.getColumnId(sortKeys[i].getSortKey().getQualifiedName()); } else { this.sortKeyIds[i] = schema.getColumnIdByName(sortKeys[i].getSortKey().getSimpleName()); } this.asc[i] = sortKeys[i].isAscending(); this.nullFirsts[i] = sortKeys[i].isNullsFirst(); this.sortKeyTypes[i] = sortKeys[i].getSortKey().getDataType().getType(); } }
/** * @param schema The schema of input tuples * @param sortKeys The description of sort keys */ public PrimitiveComparator(Schema schema, SortSpec[] sortKeys) { Preconditions.checkArgument(sortKeys.length > 0, "At least one sort key must be specified."); this.sortKeyIds = new int[sortKeys.length]; this.sortKeyTypes = new TajoDataTypes.Type[sortKeys.length]; this.asc = new boolean[sortKeys.length]; this.nullFirsts = new boolean[sortKeys.length]; for (int i = 0; i < sortKeys.length; i++) { if (sortKeys[i].getSortKey().hasQualifier()) { this.sortKeyIds[i] = schema.getColumnId(sortKeys[i].getSortKey().getQualifiedName()); } else { this.sortKeyIds[i] = schema.getColumnIdByName(sortKeys[i].getSortKey().getSimpleName()); } this.asc[i] = sortKeys[i].isAscending(); this.nullFirsts[i] = sortKeys[i].isNullsFirst(); this.sortKeyTypes[i] = sortKeys[i].getSortKey().getDataType().getType(); } }
/** * @param schema The schema of input tuples * @param sortKeys The description of sort keys */ public UnSafeComparator(Schema schema, SortSpec[] sortKeys) { Preconditions.checkArgument(sortKeys.length > 0, "At least one sort key must be specified."); this.sortKeyIds = new int[sortKeys.length]; this.sortKeyTypes = new TajoDataTypes.Type[sortKeys.length]; this.asc = new boolean[sortKeys.length]; this.nullFirsts = new boolean[sortKeys.length]; for (int i = 0; i < sortKeys.length; i++) { if (sortKeys[i].getSortKey().hasQualifier()) { this.sortKeyIds[i] = schema.getColumnId(sortKeys[i].getSortKey().getQualifiedName()); } else { this.sortKeyIds[i] = schema.getColumnIdByName(sortKeys[i].getSortKey().getSimpleName()); } this.asc[i] = sortKeys[i].isAscending(); this.nullFirsts[i] = sortKeys[i].isNullsFirst(); this.sortKeyTypes[i] = sortKeys[i].getSortKey().getDataType().getType(); } }
public SortAggregateExec(TaskAttemptContext context, GroupbyNode plan, PhysicalExec child) throws IOException { super(context, plan, child); contexts = new FunctionContext[plan.getAggFunctions() == null ? 0 : plan.getAggFunctions().length]; final Column [] keyColumns = plan.getGroupingColumns(); groupingKeyIds = new int[groupingKeyNum]; Column col; for (int idx = 0; idx < plan.getGroupingColumns().length; idx++) { col = keyColumns[idx]; if (col.hasQualifier()) { groupingKeyIds[idx] = inSchema.getColumnId(col.getQualifiedName()); } else { groupingKeyIds[idx] = inSchema.getColumnIdByName(col.getSimpleName()); } } currentKey = new VTuple(groupingKeyNum); outTuple = new VTuple(outSchema.size()); }
public RadixSortContext(UnSafeTuple[] in, Schema schema, SortSpec[] sortSpecs, Comparator<UnSafeTuple> comparator, int timSortThreshold) { this.in = in; this.out = new UnSafeTuple[in.length]; this.keys = new int[in.length]; this.maxSortKeyId = sortSpecs.length - 1; this.sortKeyIds = new int[sortSpecs.length]; sortKeyTypes = new Type[sortSpecs.length]; asc = new boolean[sortSpecs.length]; nullFirst = new boolean[sortSpecs.length]; for (int i = 0; i < sortSpecs.length; i++) { if (sortSpecs[i].getSortKey().hasQualifier()) { this.sortKeyIds[i] = schema.getColumnId(sortSpecs[i].getSortKey().getQualifiedName()); } else { this.sortKeyIds[i] = schema.getColumnIdByName(sortSpecs[i].getSortKey().getSimpleName()); } this.asc[i] = sortSpecs[i].isAscending(); this.nullFirst[i] = sortSpecs[i].isNullsFirst(); this.sortKeyTypes[i] = sortSpecs[i].getSortKey().getDataType().getType(); } this.comparator = comparator; this.timSortThreshold = timSortThreshold; }
index = node.getInSchema().getColumnId(targetInputColumn.getQualifiedName()); } else { index = node.getInSchema().getColumnIdByName(targetInputColumn.getQualifiedName());