@Override public String getCatalogName(int column) throws SQLException { Column c = schema.getColumn(column - 1); if (CatalogUtil.isFQColumnName(c.getQualifiedName())) { return CatalogUtil.splitFQTableName(c.getQualifier())[0]; } return ""; }
public static Schema getQualifiedLogicalSchema(TableDesc tableDesc, String tableName) { Schema logicalSchema = SchemaBuilder.builder().addAll(tableDesc.getLogicalSchema().getRootColumns()).build(); if (tableName != null) { logicalSchema.setQualifier(tableName); } return logicalSchema; }
private boolean ensureColumnExistance(String tableName, String columnName) throws UndefinedTableException { final TableDesc tableDesc = catalog.getTableDesc(tableName); return tableDesc.getSchema().containsByName(columnName); } }
private Schema createAllTypesConvertedSchema() { return SchemaBuilder.builder() .add(new Column("myboolean", Type.BOOLEAN)) .add(new Column("myint", Type.INT4)) .add(new Column("mylong", Type.INT8)) .add(new Column("myfloat", Type.FLOAT4)) .add(new Column("mydouble", Type.FLOAT8)) .add(new Column("mybytes", Type.BLOB)) .add(new Column("mystring", Type.TEXT)) .add(new Column("myfixed", Type.BLOB)) .build(); }
@Override public int compare(SortSpec o1, SortSpec o2) { return targetRelationSchema.getColumnId(o1.getSortKey().getSimpleName()) - targetRelationSchema.getColumnId(o2.getSortKey().getSimpleName()); } });
public static int[] getTargetIds(Schema inSchema, Schema outSchema) { int[] targetIds = new int[outSchema.size()]; int i = 0; for (Column target : outSchema.getColumns()) { targetIds[i] = inSchema.getColumnId(target.getQualifiedName()); i++; } return targetIds; }
private void prepareProjection(Column[] targets) { projectionMap = new int[targets.length]; for (int i = 0; i < targets.length; ++i) { projectionMap[i] = schema.getColumnId(targets[i].getQualifiedName()); } }
public static Schema sortSpecsToSchema(SortSpec[] sortSpecs) { Schema schema = new Schema(); for (SortSpec spec : sortSpecs) { schema.addColumn(spec.getSortKey()); } return schema; }
public Builder mergeFrom(org.apache.tajo.catalog.CatalogProtocol.GetPartitionMethodResponse other) { if (other == org.apache.tajo.catalog.CatalogProtocol.GetPartitionMethodResponse.getDefaultInstance()) return this; if (other.hasState()) { mergeState(other.getState()); } if (other.hasPartition()) { mergePartition(other.getPartition()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.tajo.catalog.CatalogProtocol.GetPartitionDescResponse other) { if (other == org.apache.tajo.catalog.CatalogProtocol.GetPartitionDescResponse.getDefaultInstance()) return this; if (other.hasState()) { mergeState(other.getState()); } if (other.hasPartition()) { mergePartition(other.getPartition()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.tajo.catalog.CatalogProtocol.GetTablespaceResponse other) { if (other == org.apache.tajo.catalog.CatalogProtocol.GetTablespaceResponse.getDefaultInstance()) return this; if (other.hasState()) { mergeState(other.getState()); } if (other.hasTablespace()) { mergeTablespace(other.getTablespace()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.apache.tajo.catalog.CatalogProtocol.GetIndexeDescResponse other) { if (other == org.apache.tajo.catalog.CatalogProtocol.GetIndexeDescResponse.getDefaultInstance()) return this; if (other.hasState()) { mergeState(other.getState()); } if (other.hasIndex()) { mergeIndex(other.getIndex()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public org.apache.tajo.catalog.CatalogProtocol.GetTablePropertiesResponse build() { org.apache.tajo.catalog.CatalogProtocol.GetTablePropertiesResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public org.apache.tajo.catalog.CatalogProtocol.GetIndexByColumnNamesRequest build() { org.apache.tajo.catalog.CatalogProtocol.GetIndexByColumnNamesRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public org.apache.tajo.catalog.CatalogProtocol.GetPartitionsResponse build() { org.apache.tajo.catalog.CatalogProtocol.GetPartitionsResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@Override public int compare(SortSpec o1, SortSpec o2) { return targetRelationSchema.getColumnId(o1.getSortKey().getSimpleName()) - targetRelationSchema.getColumnId(o2.getSortKey().getSimpleName()); } });
private void prepareProjection(Column [] targets) { projectionMap = new int[targets.length]; int tid; for (int i = 0; i < targets.length; i++) { tid = schema.getColumnId(targets[i].getQualifiedName()); projectionMap[i] = tid; } }
public Builder mergeFrom(org.apache.tajo.catalog.CatalogProtocol.GetPartitionMethodResponse other) { if (other == org.apache.tajo.catalog.CatalogProtocol.GetPartitionMethodResponse.getDefaultInstance()) return this; if (other.hasState()) { mergeState(other.getState()); } if (other.hasPartition()) { mergePartition(other.getPartition()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
private void prepareProjection(Column [] targets) { projectionMap = new int[targets.length]; int tid; for (int i = 0; i < targets.length; i++) { tid = schema.getColumnId(targets[i].getQualifiedName()); projectionMap[i] = tid; } }
private void prepareProjection(Column[] targets) { projectionMap = new int[targets.length]; for (int i = 0; i < targets.length; ++i) { projectionMap[i] = schema.getColumnId(targets[i].getQualifiedName()); } }