@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (getFieldsCount() > 0) { hash = (37 * hash) + FIELDS_FIELD_NUMBER; hash = (53 * hash) + getFieldsList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
parititonColumns = tableDesc.getPartition().getExpressionSchema().getFieldsList();
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.tajo.catalog.proto.CatalogProtos.SchemaProto)) { return super.equals(obj); } org.apache.tajo.catalog.proto.CatalogProtos.SchemaProto other = (org.apache.tajo.catalog.proto.CatalogProtos.SchemaProto) obj; boolean result = true; result = result && getFieldsList() .equals(other.getFieldsList()); result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
.getExpressionSchema().getFieldsList(), request.getAlgebra());
@Override public List<PartitionDescProto> getPartitionsByAlgebra(PartitionsByAlgebraProto request) throws UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionMethodException, UnsupportedException { List<PartitionDescProto> list = null; try { String databaseName = request.getDatabaseName(); String tableName = request.getTableName(); if (!existDatabase(databaseName)) { throw new UndefinedDatabaseException(tableName); } if (!existTable(databaseName, tableName)) { throw new UndefinedTableException(tableName); } if (!existPartitionMethod(databaseName, tableName)) { throw new UndefinedPartitionMethodException(tableName); } TableDescProto tableDesc = getTable(databaseName, tableName); String filter = getFilter(databaseName, tableName, tableDesc.getPartition().getExpressionSchema().getFieldsList() , request.getAlgebra()); list = getPartitionsFromHiveMetaStore(databaseName, tableName, filter); } catch (UnsupportedException ue) { throw ue; } catch (Exception se) { throw new TajoInternalError(se); } return list; }
/** * This Schema constructor restores a serialized schema into in-memory Schema structure. * A serialized schema is an ordered list in depth-first order over a nested schema. * This constructor transforms the list into a tree-like structure. * * @param proto */ public SchemaLegacy(SchemaProto proto) { init(); Collection<Column> toBeAdded = transform(proto.getFieldsList(), new Function<ColumnProto, Column>() { @Override public Column apply(@Nullable ColumnProto proto) { return new Column(proto); } }); for (Column c : toBeAdded) { addColumn(c); } }
/** * This Schema constructor restores a serialized schema into in-memory Schema structure. * A serialized schema is an ordered list in depth-first order over a nested schema. * This constructor transforms the list into a tree-like structure. * * @param proto */ public Schema(SchemaProto proto) { init(); List<Column> toBeAdded = TUtil.newList(); for (int i = 0; i < proto.getFieldsCount(); i++) { deserializeColumn(toBeAdded, proto.getFieldsList(), i); } for (Column c : toBeAdded) { addColumn(c); } }