@Override public void setTarget(Column[] targets) { this.target = new Schema(targets); }
@Override public Object clone() throws CloneNotSupportedException { InsertNode insertNode = (InsertNode) super.clone(); insertNode.overwrite = overwrite; insertNode.tableSchema = new Schema(tableSchema); insertNode.targetSchema = targetSchema != null ? new Schema(targetSchema) : null; insertNode.projectedSchema = projectedSchema != null ? new Schema(projectedSchema) : null; insertNode.uri = uri != null ? uri : null; return insertNode; }
public TajoMetaDataResultSet(List<String> columns, List<Type> types, List<MetaDataTuple> values) { super(null, new Schema(), null); int index = 0; if(columns != null) { for(String columnName: columns) { schema.addColumn(columnName, types.get(index++)); } } setDataTuples(values); }
private Schema sortSchema(Schema schema) { Column[] columns = schema.toArray(); Arrays.sort(columns, columnComparator); Schema sorted = new Schema(); for (Column col : columns) { sorted.addColumn(col); } return sorted; }
public static Schema sortSpecsToSchema(SortSpec[] sortSpecs) { Schema schema = new Schema(); for (SortSpec spec : sortSpecs) { schema.addColumn(spec.getSortKey()); } return schema; }
public static Schema getQualifiedLogicalSchema(TableDesc tableDesc, String tableName) { Schema logicalSchema = new Schema(tableDesc.getLogicalSchema()); if (tableName != null) { logicalSchema.setQualifier(tableName); } return logicalSchema; }
public static Schema sortSpecsToSchema(SortSpec[] sortSpecs) { Schema schema = new Schema(); for (SortSpec spec : sortSpecs) { schema.addColumn(spec.getSortKey()); } return schema; }
public static Schema sortSpecsToSchema(SortSpec[] sortSpecs) { Schema schema = new Schema(); for (SortSpec spec : sortSpecs) { schema.addColumn(spec.getSortKey()); } return schema; }
/** * Initializes the ParquetScanner. This method initializes the * TajoParquetReader. */ @Override public void init() throws IOException { if (targets == null) { targets = schema.toArray(); } reader = new TajoParquetReader(fragment.getPath(), schema, new Schema(targets)); super.init(); }
/** * This method transforms the unqualified names of a schema to the qualified names. * * @param tableName a table name to be prefixed * @param schema a schema to be transformed * * @return */ public static SchemaProto getQualfiedSchema(String tableName, SchemaProto schema) { Schema restored = new Schema(schema); restored.setQualifier(tableName); return restored.getProto(); }
/** * It transforms table definition elements to schema. * * @param elements to be transformed * @return schema transformed from table definition elements */ private Schema convertColumnsToSchema(ColumnDefinition[] elements) { Schema schema = new Schema(); for (ColumnDefinition columnDefinition: elements) { schema.addColumn(convertColumn(columnDefinition)); } return schema; }
/** * It transforms table definition elements to schema. * * @param elements to be transformed * @return schema transformed from table definition elements */ private static Schema convertTableElementsSchema(ColumnDefinition[] elements) { Schema schema = new Schema(); for (ColumnDefinition columnDefinition: elements) { schema.addColumn(convertColumn(columnDefinition)); } return schema; }
public Schema getLogicalSchema() { if (hasPartition()) { Schema logicalSchema = new Schema(tableSchema); logicalSchema.addColumns(getPartitionMethod().getExpressionSchema()); return logicalSchema; } else { return tableSchema; } }
public IndexScanInfo(TableStats tableStats, IndexDesc indexDesc, SimplePredicate[] predicates) { super(ScanTypeControl.INDEX_SCAN, tableStats); this.indexPath = indexDesc.getIndexPath(); keySchema = new Schema(); this.predicates = predicates; for (SimplePredicate predicate : predicates) { keySchema.addColumn(predicate.getKeySortSpec().getSortKey()); } }
public Schema getLogicalSchema() { if (hasPartition()) { Schema logicalSchema = new Schema(schema); logicalSchema.addColumns(getPartitionMethod().getExpressionSchema()); logicalSchema.setQualifier(tableName); return logicalSchema; } else { return schema; } }
public void loadOutSchema() { Schema q2 = new Schema() .addColumn("s_acctbal", Type.FLOAT8) .addColumn("s_name", Type.TEXT) .addColumn("n_name", Type.TEXT) .addColumn("p_partkey", Type.INT4) .addColumn("p_mfgr", Type.TEXT) .addColumn("s_address", Type.TEXT) .addColumn("s_phone", Type.TEXT) .addColumn("s_comment", Type.TEXT); outSchemas.put("q2", q2); }
public PartitionMethodDesc(CatalogProtos.PartitionMethodProto proto) { this(proto.getTableIdentifier().getDatabaseName(), proto.getTableIdentifier().getTableName(), proto.getPartitionType(), proto.getExpression(), new Schema(proto.getExpressionSchema())); }
public static Schema getSchemaByTargets(Schema inputSchema, Target[] targets) { Schema schema = new Schema(); for (Target target : targets) { schema.addColumn( target.hasAlias() ? target.getAlias() : target.getEvalTree().getName(), getDomainByExpr(inputSchema, target.getEvalTree())); } return schema; }
/** * Get common columns to be used as join keys of natural joins. */ public static Schema getNaturalJoinColumns(Schema left, Schema right) { Schema common = new Schema(); for (Column outer : left.getRootColumns()) { if (!common.containsByName(outer.getSimpleName()) && right.containsByName(outer.getSimpleName())) { common.addColumn(new Column(outer.getSimpleName(), outer.getDataType())); } } return common; }
public TableDesc(TableDescProto proto) { this(proto.getTableName(), proto.hasSchema() ? new Schema(proto.getSchema()) : null, new TableMeta(proto.getMeta()), proto.hasPath() ? URI.create(proto.getPath()) : null, proto.getIsExternal()); if(proto.hasStats()) { this.stats = new TableStats(proto.getStats()); } if (proto.hasPartition()) { this.partitionMethodDesc = new PartitionMethodDesc(proto.getPartition()); } }