@Override public List<TablePartitionProto> getAllPartitions() { List<TablePartitionProto> partitions = new ArrayList<>(); String sql = "SELECT " + COL_PARTITIONS_PK + ", " + COL_TABLES_PK + ", PARTITION_NAME, " + " PATH FROM " + TB_PARTTIONS; try (Statement stmt = getConnection().createStatement(); ResultSet resultSet = stmt.executeQuery(sql)) { while (resultSet.next()) { TablePartitionProto.Builder builder = TablePartitionProto.newBuilder(); builder.setPartitionId(resultSet.getInt(COL_PARTITIONS_PK)); builder.setTid(resultSet.getInt(COL_TABLES_PK)); builder.setPartitionName(resultSet.getString("PARTITION_NAME")); builder.setPath(resultSet.getString("PATH")); partitions.add(builder.build()); } } catch (SQLException se) { throw new TajoInternalError(se); } return partitions; }
@Override public List<TablePartitionProto> getAllPartitions() { Connection conn = null; Statement stmt = null; ResultSet resultSet = null; List<TablePartitionProto> partitions = new ArrayList<TablePartitionProto>(); try { String sql = "SELECT " + COL_PARTITIONS_PK + ", " + COL_TABLES_PK + ", PARTITION_NAME, " + " PATH FROM " + TB_PARTTIONS; conn = getConnection(); stmt = conn.createStatement(); resultSet = stmt.executeQuery(sql); while (resultSet.next()) { TablePartitionProto.Builder builder = TablePartitionProto.newBuilder(); builder.setPartitionId(resultSet.getInt(COL_PARTITIONS_PK)); builder.setTid(resultSet.getInt(COL_TABLES_PK)); builder.setPartitionName(resultSet.getString("PARTITION_NAME")); builder.setPath(resultSet.getString("PATH")); partitions.add(builder.build()); } } catch (SQLException se) { throw new TajoInternalError(se); } finally { CatalogUtil.closeQuietly(stmt, resultSet); } return partitions; }
/** * <code>repeated .TablePartitionProto part = 2;</code> */ public Builder addPart( org.apache.tajo.catalog.proto.CatalogProtos.TablePartitionProto.Builder builderForValue) { if (partBuilder_ == null) { ensurePartIsMutable(); part_.add(builderForValue.build()); onChanged(); } else { partBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .TablePartitionProto part = 2;</code> */ public Builder addPart( int index, org.apache.tajo.catalog.proto.CatalogProtos.TablePartitionProto.Builder builderForValue) { if (partBuilder_ == null) { ensurePartIsMutable(); part_.add(index, builderForValue.build()); onChanged(); } else { partBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .TablePartitionProto part = 2;</code> */ public Builder setPart( int index, org.apache.tajo.catalog.proto.CatalogProtos.TablePartitionProto.Builder builderForValue) { if (partBuilder_ == null) { ensurePartIsMutable(); part_.set(index, builderForValue.build()); onChanged(); } else { partBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .TablePartitionProto part = 2;</code> */ public Builder addPart( org.apache.tajo.catalog.proto.CatalogProtos.TablePartitionProto.Builder builderForValue) { if (partBuilder_ == null) { ensurePartIsMutable(); part_.add(builderForValue.build()); onChanged(); } else { partBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .TablePartitionProto part = 2;</code> */ public Builder addPart( int index, org.apache.tajo.catalog.proto.CatalogProtos.TablePartitionProto.Builder builderForValue) { if (partBuilder_ == null) { ensurePartIsMutable(); part_.add(index, builderForValue.build()); onChanged(); } else { partBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .TablePartitionProto part = 2;</code> */ public Builder setPart( int index, org.apache.tajo.catalog.proto.CatalogProtos.TablePartitionProto.Builder builderForValue) { if (partBuilder_ == null) { ensurePartIsMutable(); part_.set(index, builderForValue.build()); onChanged(); } else { partBuilder_.setMessage(index, builderForValue.build()); } return this; } /**