use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITWriteTest method writeFloat64ArrayNull.
@Test
public void writeFloat64ArrayNull() {
write(baseInsert().set("Float64ArrayValue").toFloat64Array((double[]) null).build());
Struct row = readLastRow("Float64ArrayValue");
assertThat(row.isNull(0)).isTrue();
}
use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITWriteTest method writeFloat64ArrayEmpty.
@Test
public void writeFloat64ArrayEmpty() {
write(baseInsert().set("Float64ArrayValue").toFloat64Array(new double[] {}).build());
Struct row = readLastRow("Float64ArrayValue");
assertThat(row.isNull(0)).isFalse();
assertThat(row.getDoubleList(0)).containsExactly();
}
use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITWriteTest method writeBytesArray.
@Test
public void writeBytesArray() {
List<ByteArray> data = Arrays.asList(ByteArray.copyFrom("a"), ByteArray.copyFrom("b"), null);
write(baseInsert().set("BytesArrayValue").toBytesArray(data).build());
Struct row = readLastRow("BytesArrayValue");
assertThat(row.isNull(0)).isFalse();
assertThat(row.getBytesList(0)).isEqualTo(data);
}
use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITQueryTest method bindStringNull.
@Test
public void bindStringNull() {
Struct row = execute(Statement.newBuilder("SELECT @v").bind("v").to((String) null), Type.string());
assertThat(row.isNull(0)).isTrue();
}
use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITQueryTest method bindTimestampArrayNull.
@Test
public void bindTimestampArrayNull() {
Struct row = execute(Statement.newBuilder("SELECT @v").bind("v").toTimestampArray(null), Type.array(Type.timestamp()));
assertThat(row.isNull(0)).isTrue();
}
Aggregations