/** * Returns schema path with for arrays without index. * Is used to find column statistics in parquet metadata. * Example: a.b.c[0] -> a.b.c, a[0].b[1] -> a.b * * @return un-indexed schema path */ public SchemaPath getUnIndexed() { NameSegment nameSegment = getUnIndexedNameSegment(rootSegment, null); return new SchemaPath(nameSegment); }
public static SchemaPath getCompoundPath(String... strings) { NameSegment s = null; // loop through strings in reverse order for (int i = strings.length - 1; i >= 0; i--) { s = new NameSegment(strings[i], s); } return new SchemaPath(s); }
public SchemaPath getChild(String childPath) { NameSegment newRoot = rootSegment.cloneWithNewChild(new NameSegment(childPath)); return new SchemaPath(newRoot); }
public SchemaPath getChild(int index) { NameSegment newRoot = rootSegment.cloneWithNewChild(new ArraySegment(index)); return new SchemaPath(newRoot); }
public static SchemaPath create(NamePart namePart) { Preconditions.checkArgument(namePart.getType() == NamePart.Type.NAME); return new SchemaPath((NameSegment) getPathSegment(namePart)); }
/** * Returns {@link SchemaPath} equivalent of the specified {@link FieldPath}. */ public static SchemaPath fieldPath2SchemaPath(FieldPath fieldPath) { Stack<FieldSegment> fieldSegments = new Stack<FieldSegment>(); FieldSegment seg = fieldPath.getRootSegment(); while (seg != null) { fieldSegments.push(seg); seg = seg.getChild(); } PathSegment child = null; while (!fieldSegments.isEmpty()) { seg = fieldSegments.pop(); if (seg.isNamed()) { child = new PathSegment.NameSegment(((FieldSegment.NameSegment)seg).getName(), child); } else { child = new PathSegment.ArraySegment(((FieldSegment.IndexSegment)seg).getIndex(), child); } } return new SchemaPath((PathSegment.NameSegment)child); }
((LookupContext)_localctx).e = new SchemaPath(((LookupContext)_localctx).pathSegment.seg, pos((((LookupContext)_localctx).pathSegment!=null?(((LookupContext)_localctx).pathSegment.start):null)) ); setState(461); match(SingleQuote); ((LookupContext)_localctx).e = new SchemaPath((((LookupContext)_localctx).Identifier!=null?((LookupContext)_localctx).Identifier.getText():null), pos(((LookupContext)_localctx).Identifier) );
public Key(SchemaPath name) { this.name = new SchemaPath(name); }
void addField(PathSegment segment) { if (segment != null && segment instanceof PathSegment.NameSegment) { newFields.add(new SchemaPath((PathSegment.NameSegment) segment)); } }
/** * Returns schema path with for arrays without index. * Is used to find column statistics in parquet metadata. * Example: a.b.c[0] -> a.b.c, a[0].b[1] -> a.b * * @return un-indexed schema path */ public SchemaPath getUnIndexed() { NameSegment nameSegment = getUnIndexedNameSegment(rootSegment, null); return new SchemaPath(nameSegment); }
public static SchemaPath getCompoundPath(String... strings) { NameSegment s = null; // loop through strings in reverse order for (int i = strings.length - 1; i >= 0; i--) { s = new NameSegment(strings[i], s); } return new SchemaPath(s); }
public SchemaPath getChild(String childPath) { NameSegment newRoot = rootSegment.cloneWithNewChild(new NameSegment(childPath)); return new SchemaPath(newRoot); }
public SchemaPath getChild(int index) { NameSegment newRoot = rootSegment.cloneWithNewChild(new ArraySegment(index)); return new SchemaPath(newRoot); }
public static SchemaPath create(NamePart namePart) { Preconditions.checkArgument(namePart.getType() == NamePart.Type.NAME); return new SchemaPath((NameSegment) getPathSegment(namePart)); }
/** * Returns {@link SchemaPath} equivalent of the specified {@link FieldPath}. */ public static SchemaPath fieldPath2SchemaPath(FieldPath fieldPath) { Stack<FieldSegment> fieldSegments = new Stack<FieldSegment>(); FieldSegment seg = fieldPath.getRootSegment(); while (seg != null) { fieldSegments.push(seg); seg = seg.getChild(); } PathSegment child = null; while (!fieldSegments.isEmpty()) { seg = fieldSegments.pop(); if (seg.isNamed()) { child = new PathSegment.NameSegment(((FieldSegment.NameSegment)seg).getName(), child); } else { child = new PathSegment.ArraySegment(((FieldSegment.IndexSegment)seg).getIndex(), child); } } return new SchemaPath((PathSegment.NameSegment)child); }
List<TypedFieldId> typedFieldIds = new ArrayList<>(); for (String toFilterField : toFilterFields) { SchemaPath schemaPath = new SchemaPath(new PathSegment.NameSegment(toFilterField), ExpressionPosition.UNKNOWN); TypedFieldId typedFieldId = container.getValueVectorId(schemaPath); int[] fieldIds = typedFieldId.getFieldIds();
/** * Creates new scan with fields from original scan and fields used in item star operator. * * @param scanRel original scan expression * @param itemStarFields item star fields * @return new scan expression */ private static DrillScanRel createNewScan(DrillScanRel scanRel, Map<String, DesiredField> itemStarFields) { RelDataType newScanRowType = createNewRowType( scanRel.getCluster().getTypeFactory(), scanRel.getRowType().getFieldList(), itemStarFields.keySet()); List<SchemaPath> columns = new ArrayList<>(scanRel.getColumns()); for (DesiredField desiredField : itemStarFields.values()) { String name = desiredField.getName(); PathSegment.NameSegment nameSegment = new PathSegment.NameSegment(name); columns.add(new SchemaPath(nameSegment)); } return new DrillScanRel( scanRel.getCluster(), scanRel.getTraitSet().plus(DrillRel.DRILL_LOGICAL), scanRel.getTable(), newScanRowType, columns); }
SchemaPath s = new SchemaPath(colNextChild.getNameSegment()); c.add(s);
for (BloomFilterDef bloomFilterDef : bloomFilterDefs) { String buildField = bloomFilterDef.getBuildField(); SchemaPath schemaPath = new SchemaPath(new PathSegment.NameSegment(buildField), ExpressionPosition.UNKNOWN); TypedFieldId typedFieldId = buildBatch.getValueVectorId(schemaPath); if (typedFieldId == null) {
((LookupContext)_localctx).e = new SchemaPath(((LookupContext)_localctx).pathSegment.seg, pos((((LookupContext)_localctx).pathSegment!=null?(((LookupContext)_localctx).pathSegment.start):null)) ); setState(461); match(SingleQuote); ((LookupContext)_localctx).e = new SchemaPath((((LookupContext)_localctx).Identifier!=null?((LookupContext)_localctx).Identifier.getText():null), pos(((LookupContext)_localctx).Identifier) );