@Override public Status insert(String table, String key, Map<String, ByteIterator> values) { Insert insert = this.kuduTable.newInsert(); PartialRow row = insert.getRow(); row.addString(KEY, key); for (int i = 1; i < schema.getColumnCount(); i++) { row.addStringUtf8(i, values.get(schema.getColumnByIndex(i).getName()).toArray()); } apply(insert); return Status.OK; }
@Override public Status update(String table, String key, Map<String, ByteIterator> values) { Update update = this.kuduTable.newUpdate(); PartialRow row = update.getRow(); row.addString(KEY, key); for (int i = 1; i < schema.getColumnCount(); i++) { String columnName = schema.getColumnByIndex(i).getName(); ByteIterator b = values.get(columnName); if (b != null) { row.addStringUtf8(columnName, b.toArray()); } } apply(update); return Status.OK; }
LocalDateTime ldt = LocalDateTime.ofEpochSecond(TimeUnit.DAYS.toSeconds(date.getDays()), 0, ZoneOffset.UTC); byte[] bytes = ldt.format(DateTimeFormatter.ISO_LOCAL_DATE).getBytes(StandardCharsets.UTF_8); row.addStringUtf8(destChannel, bytes);
switch (schema.getColumnByIndex(i).getType()) { case STRING: to.addStringUtf8(i, from.getString(i).getBytes(StandardCharsets.UTF_8)); break; case INT64:
switch (schema.getColumnByIndex(i).getType()) { case STRING: to.addStringUtf8(i, from.getString(i).getBytes(StandardCharsets.UTF_8)); break; case INT64:
/** * Add a String for the specified column. * @param columnIndex the column's index in the schema * @param val value to add * @throws IllegalArgumentException if the value doesn't match the column's type * @throws IllegalStateException if the row was already applied * @throws IndexOutOfBoundsException if the column doesn't exist */ public void addString(int columnIndex, String val) { addStringUtf8(columnIndex, Bytes.fromString(val)); }
/** * Add a String for the specified column. * @param columnName Name of the column * @param val value to add * @throws IllegalArgumentException if the column doesn't exist * or if the value doesn't match the column's type * @throws IllegalStateException if the row was already applied */ public void addString(String columnName, String val) { addStringUtf8(columnName, Bytes.fromString(val)); }
/** * Add a String for the specified value, encoded as UTF8. * Note that the provided value must not be mutated after this. * @param columnName Name of the column * @param val value to add * @throws IllegalArgumentException if the column doesn't exist * or if the value doesn't match the column's type * @throws IllegalStateException if the row was already applied * */ public void addStringUtf8(String columnName, byte[] val) { addStringUtf8(schema.getColumnIndex(columnName), val); }
row.addStringUtf8(idx, binary); break;
LocalDateTime ldt = LocalDateTime.ofEpochSecond(TimeUnit.DAYS.toSeconds(date.getDays()), 0, ZoneOffset.UTC); byte[] bytes = ldt.format(DateTimeFormatter.ISO_LOCAL_DATE).getBytes(Charsets.UTF_8); row.addStringUtf8(destChannel, bytes); } else { row.addString(destChannel, type.getSlice(block, position).toStringUtf8());
break; case STRING: addStringUtf8(index, AsyncKuduClient.EMPTY_ARRAY); break; case BINARY:
LocalDateTime ldt = LocalDateTime.ofEpochSecond(TimeUnit.DAYS.toSeconds(date.getDays()), 0, ZoneOffset.UTC); byte[] bytes = ldt.format(DateTimeFormatter.ISO_LOCAL_DATE).getBytes(StandardCharsets.UTF_8); row.addStringUtf8(destChannel, bytes);
switch (schema.getColumnByIndex(i).getType()) { case STRING: to.addStringUtf8(i, from.getString(i).getBytes(Charsets.UTF_8)); break; case INT64:
switch (schema.getColumnByIndex(i).getType()) { case STRING: to.addStringUtf8(i, from.getString(i).getBytes(Charsets.UTF_8)); break; case INT64:
switch (schema.getColumnByIndex(i).getType()) { case STRING: to.addStringUtf8(i, from.getString(i).getBytes(StandardCharsets.UTF_8)); break; case INT64:
switch (schema.getColumnByIndex(i).getType()) { case STRING: to.addStringUtf8(i, from.getString(i).getBytes(StandardCharsets.UTF_8)); break; case INT64: