public static PartialRow decodeRangePartitionKey(Schema schema, PartitionSchema partitionSchema, byte[] key) { return KeyEncoder.decodeRangePartitionKey(schema, partitionSchema, key); } }
public static PartialRow decodeRangePartitionKey(Schema schema, PartitionSchema partitionSchema, byte[] key) { return KeyEncoder.decodeRangePartitionKey(schema, partitionSchema, key); } }
public static PartialRow decodeRangePartitionKey(Schema schema, PartitionSchema partitionSchema, byte[] key) { return KeyEncoder.decodeRangePartitionKey(schema, partitionSchema, key); } }
/** * Decodes a range partition key into a partial row. * * @param schema the schema of the table * @param partitionSchema the partition schema of the table * @param key the encoded range partition key * @return the decoded range key */ public static PartialRow decodeRangePartitionKey(Schema schema, PartitionSchema partitionSchema, byte[] key) { ByteBuffer buf = ByteBuffer.wrap(key); buf.order(ByteOrder.BIG_ENDIAN); return decodeRangePartitionKey(schema, partitionSchema, buf); }
/** * Decodes a partition key into a list of hash buckets and range key * * @param schema the schema of the table * @param partitionSchema the partition schema of the table * @param key the encoded partition key * @return the decoded buckets and range key */ public static Pair<List<Integer>, PartialRow> decodePartitionKey(Schema schema, PartitionSchema partitionSchema, byte[] key) { ByteBuffer buf = ByteBuffer.wrap(key); buf.order(ByteOrder.BIG_ENDIAN); List<Integer> buckets = new ArrayList<>(); for (HashBucketSchema hashSchema : partitionSchema.getHashBucketSchemas()) { if (buf.hasRemaining()) { buckets.add(buf.getInt()); } else { buckets.add(0); } } return new Pair<>(buckets, decodeRangePartitionKey(schema, partitionSchema, buf)); }
/** * Gets the decoded end range key. * @return the decoded end range key */ public PartialRow getDecodedRangeKeyEnd(KuduTable table) { Schema schema = table.getSchema(); if (rangeKeyEnd.length == 0) { return schema.newPartialRow(); } else { PartitionSchema partitionSchema = table.getPartitionSchema(); return KeyEncoder.decodeRangePartitionKey(schema, partitionSchema, rangeKeyEnd); } }
/** * Gets the decoded start range key. * @return the decoded start range key */ public PartialRow getDecodedRangeKeyStart(KuduTable table) { Schema schema = table.getSchema(); if (rangeKeyStart.length == 0) { return schema.newPartialRow(); } else { PartitionSchema partitionSchema = table.getPartitionSchema(); return KeyEncoder.decodeRangePartitionKey(schema, partitionSchema, rangeKeyStart); } }
sb.append('('); KeyEncoder.decodeRangePartitionKey(schema, partitionSchema, rangeKeyStart) .appendShortDebugString(idxs, sb); if (numColumns > 1) { sb.append('('); KeyEncoder.decodeRangePartitionKey(schema, partitionSchema, rangeKeyEnd) .appendShortDebugString(idxs, sb); if (numColumns > 1) { KeyEncoder.decodeRangePartitionKey(schema, partitionSchema, rangeKeyStart); PartialRow upperBound = KeyEncoder.decodeRangePartitionKey(schema, partitionSchema, rangeKeyEnd);