use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITQueryTest method arrayOfStructNull.
// Not yet supported by the backend.
@Ignore
@Test
public void arrayOfStructNull() {
Type structType = Type.struct(StructField.of("", Type.string()), StructField.of("", Type.int64()));
Struct row = execute(Statement.of("SELECT CAST (NULL AS ARRAY<STRUCT<string,int64>>)"), Type.array(structType));
assertThat(row.isNull(0)).isTrue();
}
use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITWriteTest method writeBytesArrayEmpty.
@Test
public void writeBytesArrayEmpty() {
write(baseInsert().set("BytesArrayValue").toBytesArray(Arrays.<ByteArray>asList()).build());
Struct row = readLastRow("BytesArrayValue");
assertThat(row.isNull(0)).isFalse();
assertThat(row.getBytesList(0)).containsExactly();
}
use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITWriteTest method writeInt64ArrayNoNulls.
@Test
public void writeInt64ArrayNoNulls() {
write(baseInsert().set("Int64ArrayValue").toInt64Array(Arrays.asList(1L, 2L)).build());
Struct row = readLastRow("Int64ArrayValue");
assertThat(row.isNull(0)).isFalse();
assertThat(row.getLongArray(0)).isEqualTo(new long[] { 1, 2 });
}
use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITWriteTest method writeBytesNull.
@Test
public void writeBytesNull() {
write(baseInsert().set("BytesValue").to((ByteArray) null).build());
Struct row = readLastRow("BytesValue");
assertThat(row.isNull(0)).isTrue();
}
use of com.google.cloud.spanner.Struct in project google-cloud-java by GoogleCloudPlatform.
the class ITWriteTest method writeDateArrayEmpty.
@Test
public void writeDateArrayEmpty() {
write(baseInsert().set("DateArrayValue").toDateArray(Arrays.<Date>asList()).build());
Struct row = readLastRow("DateArrayValue");
assertThat(row.isNull(0)).isFalse();
assertThat(row.getDateList(0)).containsExactly();
}
Aggregations