boolean isRowKey = field.getRootSegmentPath().equals(ROW_KEY); if (!(isRowKey || (!field.getRootSegment().isLastPath() && field.getRootSegment().getChild().isLastPath() && field.getRootSegment().getChild().isNamed())
boolean isRowKey = field.getRootSegmentPath().equals(ROW_KEY); if (!(isRowKey || (!field.getRootSegment().isLastPath() && field.getRootSegment().getChild().isLastPath() && field.getRootSegment().getChild().isNamed())
@Override public RexNode visitSchemaPath(SchemaPath path, Void value) throws RuntimeException { PathSegment.NameSegment rootSegment = path.getRootSegment(); if (rootSegment.isLastPath()) { final RelDataTypeField field = findField(rootSegment.getPath(), newRowType); return field == null ? null : builder.makeInputRef(field.getType(), field.getIndex()); } List<String> paths = Lists.newArrayList(); while (rootSegment != null) { paths.add(rootSegment.getPath()); rootSegment = (PathSegment.NameSegment) rootSegment.getChild(); } return makeItemOperator(paths.toArray(new String[0]), paths.size() - 1, newRowType); }
boolean isRowKey = field.getRootSegmentPath().equals(ROW_KEY); if (!(isRowKey || (!field.getRootSegment().isLastPath() && field.getRootSegment().getChild().isLastPath() && field.getRootSegment().getChild().isNamed())
boolean isRowKey = field.getRootSegmentPath().equals(ROW_KEY); if (!(isRowKey || (!field.getRootSegment().isLastPath() && field.getRootSegment().getChild().isLastPath() && field.getRootSegment().getChild().isNamed())
public static String getFullPath(PathSegment pathSeg) { PathSegment.NameSegment nameSeg = (PathSegment.NameSegment)pathSeg; if (nameSeg.isLastPath()) { return nameSeg.getPath(); } return String.format("%s.%s", nameSeg.getPath(), getFullPath(nameSeg.getChild())); }
/** * Determine if this is a one-part name. In general, special columns work only * if they are single-part names. * * @return true if this is a one-part name, false if this is a multi-part * name (with either map member or array index parts.) */ public boolean isLeaf() { return rootSegment.isLastPath(); }
/** * Determine if this is a one-part name. In general, special columns work only * if they are single-part names. * * @return true if this is a one-part name, false if this is a multi-part * name (with either map member or array index parts.) */ public boolean isLeaf() { return rootSegment.isLastPath(); }