@Override public double[] getDoubleArray(int columnIndex) { return getCurrentRowAsStruct().getDoubleArray(columnIndex); }
@Override public double[] getDoubleArray(String columnName) { return getCurrentRowAsStruct().getDoubleArray(columnName); }
@Test public void writeFloat64ArrayNoNulls() { write(baseInsert().set("Float64ArrayValue").toFloat64Array(Arrays.asList(1.0, 2.0)).build()); Struct row = readLastRow("Float64ArrayValue"); assertThat(row.isNull(0)).isFalse(); assertThat(row.getDoubleArray(0).length).isEqualTo(2); assertThat(row.getDoubleArray(0)[0]).isWithin(0.0).of(1.0); assertThat(row.getDoubleArray(0)[1]).isWithin(0.0).of(2.0); }
@Test public void writeFloat64Array() { write( baseInsert() .set("Float64ArrayValue") .toFloat64Array(Arrays.asList(null, 1.0, 2.0)) .build()); Struct row = readLastRow("Float64ArrayValue"); assertThat(row.isNull(0)).isFalse(); assertThat(row.getDoubleList(0)).containsExactly(null, 1.0, 2.0).inOrder(); expectedException.expect(NullPointerException.class); row.getDoubleArray(0); }
return Value.bytesArray(value.getBytesList(fieldIndex)); case FLOAT64: return Value.float64Array(value.getDoubleArray(fieldIndex)); case DATE: return Value.dateArray(value.getDateList(fieldIndex));
@Override public double[] getDoubleArray(String columnName) { return getCurrentRowAsStruct().getDoubleArray(columnName); }
@Override public double[] getDoubleArray(int columnIndex) { return getCurrentRowAsStruct().getDoubleArray(columnIndex); }
return GSON.toJson(currentRow.getLongArray(columnName)); case FLOAT64: return GSON.toJson(currentRow.getDoubleArray(columnName)); case STRING: return GSON.toJson(currentRow.getStringList(columnName));
return Value.bytesArray(value.getBytesList(fieldIndex)); case FLOAT64: return Value.float64Array(value.getDoubleArray(fieldIndex)); case DATE: return Value.dateArray(value.getDateList(fieldIndex));