private PartialRow buildPrimaryKey() { Schema schema = table.getSchema(); PartialRow row = new PartialRow(schema); RowHelper.copyPrimaryKey(schema, currentRow, row); return row; } }
public static PartialRow toRangeBoundToPartialRow(Schema schema, RangePartitionDefinition definition, RangeBoundValue boundValue) { PartialRow partialRow = new PartialRow(schema); if (boundValue != null) { List<Integer> rangeColumns = definition.getColumns().stream() .map(schema::getColumnIndex).collect(toImmutableList()); if (rangeColumns.size() != boundValue.getValues().size()) { throw new IllegalStateException("Expected " + rangeColumns.size() + " range columns, but got " + boundValue.getValues().size()); } for (int i = 0; i < rangeColumns.size(); i++) { Object obj = boundValue.getValues().get(i); int idx = rangeColumns.get(i); ColumnSchema columnSchema = schema.getColumnByIndex(idx); setColumnValue(partialRow, idx, obj, columnSchema.getType(), columnSchema.getName()); } } return partialRow; }
/** * Creates a new partial row for the schema. * @return a new partial row */ public PartialRow newPartialRow() { return new PartialRow(this); } }
/** * Add a range partition split. The split row must fall in a range partition, * and causes the range partition to split into two contiguous range partitions. * The row may be reused or modified safely after this call without changing * the split point. * * @param row a key row for the split point * @return this instance */ public CreateTableOptions addSplitRow(PartialRow row) { splitRows.add(new PartialRow(row)); return this; }
private PartialRow buildPrimaryKey() { Schema schema = table.getSchema(); PartialRow row = new PartialRow(schema); RowHelper.copyPrimaryKey(schema, currentRow, row); return row; } }
private PartialRow buildPrimaryKey() { Schema schema = table.getSchema(); PartialRow row = new PartialRow(schema); RowHelper.copyPrimaryKey(schema, currentRow, row); return row; } }
public static PartialRow toRangeBoundToPartialRow(Schema schema, RangePartitionDefinition definition, RangeBoundValue boundValue) { PartialRow partialRow = new PartialRow(schema); if (boundValue != null) { List<Integer> rangeColumns = definition.getColumns().stream() .map(schema::getColumnIndex).collect(toImmutableList()); if (rangeColumns.size() != boundValue.getValues().size()) { throw new IllegalStateException("Expected " + rangeColumns.size() + " range columns, but got " + boundValue.getValues().size()); } for (int i = 0; i < rangeColumns.size(); i++) { Object obj = boundValue.getValues().get(i); int idx = rangeColumns.get(i); ColumnSchema columnSchema = schema.getColumnByIndex(idx); setColumnValue(partialRow, idx, obj, columnSchema.getType(), columnSchema.getName()); } } return partialRow; }
public static PartialRow toRangeBoundToPartialRow(Schema schema, RangePartitionDefinition definition, RangeBoundValue boundValue) { PartialRow partialRow = new PartialRow(schema); if (boundValue != null) { List<Integer> rangeColumns = definition.getColumns().stream() .map(name -> schema.getColumnIndex(name)).collect(toImmutableList()); if (rangeColumns.size() != boundValue.getValues().size()) { throw new IllegalStateException("Expected " + rangeColumns.size() + " range columns, but got " + boundValue.getValues().size()); } for (int i = 0; i < rangeColumns.size(); i++) { Object obj = boundValue.getValues().get(i); int idx = rangeColumns.get(i); ColumnSchema columnSchema = schema.getColumnByIndex(idx); setColumnValue(partialRow, idx, obj, columnSchema.getType(), columnSchema.getName()); } } return partialRow; }
PartialRow newRow = new PartialRow(row); newRow.setRaw(idx, predicateValue); newRows.add(newRow);