From ff9ffc97e69ca5ac8c735f7a826e15c806756299 Mon Sep 17 00:00:00 2001 From: Nithin Nayak Sujir Date: Fri, 21 Sep 2018 08:35:48 -0700 Subject: [PATCH 1/3] spanner: Expand test coverage for ResultSets ResultSets coverage now at 99%. --- .../google/cloud/spanner/ResultSetsTest.java | 148 +++++++++++++++++- 1 file changed, 146 insertions(+), 2 deletions(-) diff --git a/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java b/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java index 361ade38e09c..e17fd2cb28f1 100644 --- a/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java +++ b/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java @@ -17,7 +17,14 @@ package com.google.cloud.spanner; import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.fail; +import com.google.cloud.ByteArray; +import com.google.cloud.Date; +import com.google.cloud.Timestamp; +import com.google.common.primitives.Booleans; +import com.google.common.primitives.Doubles; +import com.google.common.primitives.Longs; import java.util.Arrays; import java.util.List; import org.junit.Rule; @@ -34,11 +41,51 @@ public class ResultSetsTest { @Test public void resultSetIteration() { + double dval = 1.2; + String s = "s"; + String byt = "101"; + long us = 32343; + int yr = 2018; + int month = 5; + int day = 26; + boolean[] ba = { true, false, true, true, false }; + long[] la = { Long.MAX_VALUE, Long.MIN_VALUE, 0, 1, -1 }; + double[] da = { Double.MIN_VALUE, Double.MAX_VALUE, 0, 1, -1, 1.2341 }; + ByteArray[] byta = { + ByteArray.copyFrom("123"), + ByteArray.copyFrom("456"), + ByteArray.copyFrom("789") + }; + Timestamp[] tsa = { + Timestamp.ofTimeMicroseconds(101), + Timestamp.ofTimeMicroseconds(202), + Timestamp.ofTimeMicroseconds(303) + }; + Date[] dta = { + Date.fromYearMonthDay(1, 2, 3), + Date.fromYearMonthDay(4, 5, 6), + Date.fromYearMonthDay(7, 8, 9) + }; + String[] sa = { "abc", "def", "ghi" }; + Type type = Type.struct( Type.StructField.of("f1", Type.string()), Type.StructField.of("f2", Type.int64()), - Type.StructField.of("f3", Type.bool())); + Type.StructField.of("f3", Type.bool()), + Type.StructField.of("d", Type.float64()), + Type.StructField.of("s", Type.string()), + Type.StructField.of("byt", Type.bytes()), + Type.StructField.of("ts", Type.timestamp()), + Type.StructField.of("dt", Type.date()), + Type.StructField.of("ba", Type.array(Type.bool())), + Type.StructField.of("la", Type.array(Type.int64())), + Type.StructField.of("da", Type.array(Type.float64())), + Type.StructField.of("byta", Type.array(Type.bytes())), + Type.StructField.of("tsa", Type.array(Type.timestamp())), + Type.StructField.of("dta", Type.array(Type.date())), + Type.StructField.of("sa", Type.array(Type.string())) + ); Struct struct1 = Struct.newBuilder() .set("f1") @@ -47,6 +94,30 @@ public void resultSetIteration() { .to(2) .set("f3") .to(Value.bool(true)) + .set("d") + .to(Value.float64(dval)) + .set("s") + .to(s) + .set("byt") + .to(Value.bytes(ByteArray.copyFrom(byt))) + .set("ts") + .to(Timestamp.ofTimeMicroseconds(us)) + .set("dt") + .to(Date.fromYearMonthDay(yr, month, day)) + .set("ba") + .to(Value.boolArray(ba)) + .set("la") + .to(Value.int64Array(la)) + .set("da") + .to(Value.float64Array(da)) + .set("byta") + .to(Value.bytesArray(Arrays.asList(byta))) + .set("tsa") + .to(Value.timestampArray(Arrays.asList(tsa))) + .set("dta") + .to(Value.dateArray(Arrays.asList(dta))) + .set("sa") + .to(Value.stringArray(Arrays.asList(sa))) .build(); Struct struct2 = Struct.newBuilder() @@ -56,13 +127,46 @@ public void resultSetIteration() { .to(3) .set("f3") .to(Value.bool(null)) + .set("d") + .to(Value.float64(dval)) + .set("s") + .to(s) + .set("byt") + .to(Value.bytes(ByteArray.copyFrom(byt))) + .set("ts") + .to(Timestamp.ofTimeMicroseconds(us)) + .set("dt") + .to(Date.fromYearMonthDay(yr, month, day)) + .set("ba") + .to(Value.boolArray(ba)) + .set("la") + .to(Value.int64Array(la)) + .set("da") + .to(Value.float64Array(da)) + .set("byta") + .to(Value.bytesArray(Arrays.asList(byta))) + .set("tsa") + .to(Value.timestampArray(Arrays.asList(tsa))) + .set("dta") + .to(Value.dateArray(Arrays.asList(dta))) + .set("sa") + .to(Value.stringArray(Arrays.asList(sa))) .build(); ResultSet rs = ResultSets.forRows(type, Arrays.asList(struct1, struct2)); + try { + rs.getType(); + fail("Exception expected"); + } catch(IllegalStateException e) { + assertThat(e.getMessage()) + .contains("Must be preceded by a next() call"); + } + assertThat(rs.next()).isTrue(); assertThat(rs.getType()).isEqualTo(type); - assertThat(rs.getColumnCount()).isEqualTo(3); + assertThat(rs.getColumnCount()).isEqualTo(type.getStructFields().size()); assertThat(rs.getColumnIndex("f1")).isEqualTo(0); + assertThat(rs.getColumnType("nonexistent")).isNull(); assertThat(rs.getColumnType("f1")).isEqualTo(Type.string()); assertThat(rs.getColumnType(0)).isEqualTo(Type.string()); assertThat(rs.getColumnIndex("f2")).isEqualTo(1); @@ -75,12 +179,52 @@ public void resultSetIteration() { assertThat(rs.getString(0)).isEqualTo("x"); assertThat(rs.getLong(1)).isEqualTo(2L); assertThat(rs.getBoolean(2)).isTrue(); + assertThat(rs.getBoolean("f3")).isTrue(); + assertThat(rs.getDouble("d")).isWithin(0.0).of(dval); + assertThat(rs.getDouble(3)).isWithin(0.0).of(dval); + assertThat(rs.getString(4)).isEqualTo(s); + assertThat(rs.getString("s")).isEqualTo(s); + assertThat(rs.getBytes(5)).isEqualTo(ByteArray.copyFrom(byt)); + assertThat(rs.getBytes("byt")).isEqualTo(ByteArray.copyFrom(byt)); + assertThat(rs.getTimestamp(6)).isEqualTo(Timestamp.ofTimeMicroseconds(us)); + assertThat(rs.getTimestamp("ts")).isEqualTo(Timestamp.ofTimeMicroseconds(us)); + assertThat(rs.getDate(7)).isEqualTo(Date.fromYearMonthDay(yr, month, day)); + assertThat(rs.getDate("dt")).isEqualTo(Date.fromYearMonthDay(yr, month, day)); + assertThat(rs.getBooleanArray(8)).isEqualTo(ba); + assertThat(rs.getBooleanArray("ba")).isEqualTo(ba); + assertThat(rs.getBooleanList(8)).isEqualTo(Booleans.asList(ba)); + assertThat(rs.getBooleanList("ba")).isEqualTo(Booleans.asList(ba)); + assertThat(rs.getLongArray(9)).isEqualTo(la); + assertThat(rs.getLongArray("la")).isEqualTo(la); + assertThat(rs.getLongList(9)).isEqualTo(Longs.asList(la)); + assertThat(rs.getLongList("la")).isEqualTo(Longs.asList(la)); + assertThat(rs.getDoubleArray(10)).isEqualTo(da, 0.0); + assertThat(rs.getDoubleArray("da")).isEqualTo(da, 0.0); + assertThat(rs.getDoubleList(10)).isEqualTo(Doubles.asList(da)); + assertThat(rs.getDoubleList("da")).isEqualTo(Doubles.asList(da)); + assertThat(rs.getBytesList(11)).isEqualTo(Arrays.asList(byta)); + assertThat(rs.getBytesList("byta")).isEqualTo(Arrays.asList(byta)); + assertThat(rs.getTimestampList(12)).isEqualTo(Arrays.asList(tsa)); + assertThat(rs.getTimestampList("tsa")).isEqualTo(Arrays.asList(tsa)); + assertThat(rs.getDateList(13)).isEqualTo(Arrays.asList(dta)); + assertThat(rs.getDateList("dta")).isEqualTo(Arrays.asList(dta)); + assertThat(rs.getStringList(14)).isEqualTo(Arrays.asList(sa)); + assertThat(rs.getStringList("sa")).isEqualTo(Arrays.asList(sa)); + assertThat(rs.next()).isTrue(); assertThat(rs.getCurrentRowAsStruct()).isEqualTo(struct2); assertThat(rs.getString(0)).isEqualTo("y"); assertThat(rs.getLong(1)).isEqualTo(3L); assertThat(rs.isNull(2)).isTrue(); assertThat(rs.next()).isFalse(); + + try { + rs.getStats(); + fail("Exception expected"); + } catch(UnsupportedOperationException e) { + assertThat(e.getMessage()) + .contains("ResultSetStats are available only for results returned from analyzeQuery"); + } } @Test From 5469dd703407d31e3b505624429e14215ab79a37 Mon Sep 17 00:00:00 2001 From: Nithin Nayak Sujir Date: Mon, 24 Sep 2018 08:56:31 -0700 Subject: [PATCH 2/3] Use longer variable names --- .../google/cloud/spanner/ResultSetsTest.java | 198 +++++++++--------- 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java b/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java index e17fd2cb28f1..238f8d4e5f87 100644 --- a/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java +++ b/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java @@ -41,50 +41,50 @@ public class ResultSetsTest { @Test public void resultSetIteration() { - double dval = 1.2; - String s = "s"; - String byt = "101"; - long us = 32343; - int yr = 2018; + double doubleVal = 1.2; + String stringVal = "stringVal"; + String byteVal = "101"; + long usecs = 32343; + int year = 2018; int month = 5; int day = 26; - boolean[] ba = { true, false, true, true, false }; - long[] la = { Long.MAX_VALUE, Long.MIN_VALUE, 0, 1, -1 }; - double[] da = { Double.MIN_VALUE, Double.MAX_VALUE, 0, 1, -1, 1.2341 }; - ByteArray[] byta = { + boolean[] boolArray = { true, false, true, true, false }; + long[] longArray = { Long.MAX_VALUE, Long.MIN_VALUE, 0, 1, -1 }; + double[] doubleArray = { Double.MIN_VALUE, Double.MAX_VALUE, 0, 1, -1, 1.2341 }; + ByteArray[] byteArray = { ByteArray.copyFrom("123"), ByteArray.copyFrom("456"), ByteArray.copyFrom("789") }; - Timestamp[] tsa = { + Timestamp[] timestampArray = { Timestamp.ofTimeMicroseconds(101), Timestamp.ofTimeMicroseconds(202), Timestamp.ofTimeMicroseconds(303) }; - Date[] dta = { + Date[] dateArray = { Date.fromYearMonthDay(1, 2, 3), Date.fromYearMonthDay(4, 5, 6), Date.fromYearMonthDay(7, 8, 9) }; - String[] sa = { "abc", "def", "ghi" }; + String[] stringArray = { "abc", "def", "ghi" }; Type type = Type.struct( Type.StructField.of("f1", Type.string()), Type.StructField.of("f2", Type.int64()), Type.StructField.of("f3", Type.bool()), - Type.StructField.of("d", Type.float64()), - Type.StructField.of("s", Type.string()), - Type.StructField.of("byt", Type.bytes()), + Type.StructField.of("doubleVal", Type.float64()), + Type.StructField.of("stringVal", Type.string()), + Type.StructField.of("byteVal", Type.bytes()), Type.StructField.of("ts", Type.timestamp()), - Type.StructField.of("dt", Type.date()), - Type.StructField.of("ba", Type.array(Type.bool())), - Type.StructField.of("la", Type.array(Type.int64())), - Type.StructField.of("da", Type.array(Type.float64())), - Type.StructField.of("byta", Type.array(Type.bytes())), - Type.StructField.of("tsa", Type.array(Type.timestamp())), - Type.StructField.of("dta", Type.array(Type.date())), - Type.StructField.of("sa", Type.array(Type.string())) + Type.StructField.of("date", Type.date()), + Type.StructField.of("boolArray", Type.array(Type.bool())), + Type.StructField.of("longArray", Type.array(Type.int64())), + Type.StructField.of("doubleArray", Type.array(Type.float64())), + Type.StructField.of("byteArray", Type.array(Type.bytes())), + Type.StructField.of("timestampArray", Type.array(Type.timestamp())), + Type.StructField.of("dateArray", Type.array(Type.date())), + Type.StructField.of("stringArray", Type.array(Type.string())) ); Struct struct1 = Struct.newBuilder() @@ -94,30 +94,30 @@ public void resultSetIteration() { .to(2) .set("f3") .to(Value.bool(true)) - .set("d") - .to(Value.float64(dval)) - .set("s") - .to(s) - .set("byt") - .to(Value.bytes(ByteArray.copyFrom(byt))) + .set("doubleVal") + .to(Value.float64(doubleVal)) + .set("stringVal") + .to(stringVal) + .set("byteVal") + .to(Value.bytes(ByteArray.copyFrom(byteVal))) .set("ts") - .to(Timestamp.ofTimeMicroseconds(us)) - .set("dt") - .to(Date.fromYearMonthDay(yr, month, day)) - .set("ba") - .to(Value.boolArray(ba)) - .set("la") - .to(Value.int64Array(la)) - .set("da") - .to(Value.float64Array(da)) - .set("byta") - .to(Value.bytesArray(Arrays.asList(byta))) - .set("tsa") - .to(Value.timestampArray(Arrays.asList(tsa))) - .set("dta") - .to(Value.dateArray(Arrays.asList(dta))) - .set("sa") - .to(Value.stringArray(Arrays.asList(sa))) + .to(Timestamp.ofTimeMicroseconds(usecs)) + .set("date") + .to(Date.fromYearMonthDay(year, month, day)) + .set("boolArray") + .to(Value.boolArray(boolArray)) + .set("longArray") + .to(Value.int64Array(longArray)) + .set("doubleArray") + .to(Value.float64Array(doubleArray)) + .set("byteArray") + .to(Value.bytesArray(Arrays.asList(byteArray))) + .set("timestampArray") + .to(Value.timestampArray(Arrays.asList(timestampArray))) + .set("dateArray") + .to(Value.dateArray(Arrays.asList(dateArray))) + .set("stringArray") + .to(Value.stringArray(Arrays.asList(stringArray))) .build(); Struct struct2 = Struct.newBuilder() @@ -127,30 +127,30 @@ public void resultSetIteration() { .to(3) .set("f3") .to(Value.bool(null)) - .set("d") - .to(Value.float64(dval)) - .set("s") - .to(s) - .set("byt") - .to(Value.bytes(ByteArray.copyFrom(byt))) + .set("doubleVal") + .to(Value.float64(doubleVal)) + .set("stringVal") + .to(stringVal) + .set("byteVal") + .to(Value.bytes(ByteArray.copyFrom(byteVal))) .set("ts") - .to(Timestamp.ofTimeMicroseconds(us)) - .set("dt") - .to(Date.fromYearMonthDay(yr, month, day)) - .set("ba") - .to(Value.boolArray(ba)) - .set("la") - .to(Value.int64Array(la)) - .set("da") - .to(Value.float64Array(da)) - .set("byta") - .to(Value.bytesArray(Arrays.asList(byta))) - .set("tsa") - .to(Value.timestampArray(Arrays.asList(tsa))) - .set("dta") - .to(Value.dateArray(Arrays.asList(dta))) - .set("sa") - .to(Value.stringArray(Arrays.asList(sa))) + .to(Timestamp.ofTimeMicroseconds(usecs)) + .set("date") + .to(Date.fromYearMonthDay(year, month, day)) + .set("boolArray") + .to(Value.boolArray(boolArray)) + .set("longArray") + .to(Value.int64Array(longArray)) + .set("doubleArray") + .to(Value.float64Array(doubleArray)) + .set("byteArray") + .to(Value.bytesArray(Arrays.asList(byteArray))) + .set("timestampArray") + .to(Value.timestampArray(Arrays.asList(timestampArray))) + .set("dateArray") + .to(Value.dateArray(Arrays.asList(dateArray))) + .set("stringArray") + .to(Value.stringArray(Arrays.asList(stringArray))) .build(); ResultSet rs = ResultSets.forRows(type, Arrays.asList(struct1, struct2)); @@ -180,36 +180,36 @@ public void resultSetIteration() { assertThat(rs.getLong(1)).isEqualTo(2L); assertThat(rs.getBoolean(2)).isTrue(); assertThat(rs.getBoolean("f3")).isTrue(); - assertThat(rs.getDouble("d")).isWithin(0.0).of(dval); - assertThat(rs.getDouble(3)).isWithin(0.0).of(dval); - assertThat(rs.getString(4)).isEqualTo(s); - assertThat(rs.getString("s")).isEqualTo(s); - assertThat(rs.getBytes(5)).isEqualTo(ByteArray.copyFrom(byt)); - assertThat(rs.getBytes("byt")).isEqualTo(ByteArray.copyFrom(byt)); - assertThat(rs.getTimestamp(6)).isEqualTo(Timestamp.ofTimeMicroseconds(us)); - assertThat(rs.getTimestamp("ts")).isEqualTo(Timestamp.ofTimeMicroseconds(us)); - assertThat(rs.getDate(7)).isEqualTo(Date.fromYearMonthDay(yr, month, day)); - assertThat(rs.getDate("dt")).isEqualTo(Date.fromYearMonthDay(yr, month, day)); - assertThat(rs.getBooleanArray(8)).isEqualTo(ba); - assertThat(rs.getBooleanArray("ba")).isEqualTo(ba); - assertThat(rs.getBooleanList(8)).isEqualTo(Booleans.asList(ba)); - assertThat(rs.getBooleanList("ba")).isEqualTo(Booleans.asList(ba)); - assertThat(rs.getLongArray(9)).isEqualTo(la); - assertThat(rs.getLongArray("la")).isEqualTo(la); - assertThat(rs.getLongList(9)).isEqualTo(Longs.asList(la)); - assertThat(rs.getLongList("la")).isEqualTo(Longs.asList(la)); - assertThat(rs.getDoubleArray(10)).isEqualTo(da, 0.0); - assertThat(rs.getDoubleArray("da")).isEqualTo(da, 0.0); - assertThat(rs.getDoubleList(10)).isEqualTo(Doubles.asList(da)); - assertThat(rs.getDoubleList("da")).isEqualTo(Doubles.asList(da)); - assertThat(rs.getBytesList(11)).isEqualTo(Arrays.asList(byta)); - assertThat(rs.getBytesList("byta")).isEqualTo(Arrays.asList(byta)); - assertThat(rs.getTimestampList(12)).isEqualTo(Arrays.asList(tsa)); - assertThat(rs.getTimestampList("tsa")).isEqualTo(Arrays.asList(tsa)); - assertThat(rs.getDateList(13)).isEqualTo(Arrays.asList(dta)); - assertThat(rs.getDateList("dta")).isEqualTo(Arrays.asList(dta)); - assertThat(rs.getStringList(14)).isEqualTo(Arrays.asList(sa)); - assertThat(rs.getStringList("sa")).isEqualTo(Arrays.asList(sa)); + assertThat(rs.getDouble("doubleVal")).isWithin(0.0).of(doubleVal); + assertThat(rs.getDouble(3)).isWithin(0.0).of(doubleVal); + assertThat(rs.getString(4)).isEqualTo(stringVal); + assertThat(rs.getString("stringVal")).isEqualTo(stringVal); + assertThat(rs.getBytes(5)).isEqualTo(ByteArray.copyFrom(byteVal)); + assertThat(rs.getBytes("byteVal")).isEqualTo(ByteArray.copyFrom(byteVal)); + assertThat(rs.getTimestamp(6)).isEqualTo(Timestamp.ofTimeMicroseconds(usecs)); + assertThat(rs.getTimestamp("ts")).isEqualTo(Timestamp.ofTimeMicroseconds(usecs)); + assertThat(rs.getDate(7)).isEqualTo(Date.fromYearMonthDay(year, month, day)); + assertThat(rs.getDate("date")).isEqualTo(Date.fromYearMonthDay(year, month, day)); + assertThat(rs.getBooleanArray(8)).isEqualTo(boolArray); + assertThat(rs.getBooleanArray("boolArray")).isEqualTo(boolArray); + assertThat(rs.getBooleanList(8)).isEqualTo(Booleans.asList(boolArray)); + assertThat(rs.getBooleanList("boolArray")).isEqualTo(Booleans.asList(boolArray)); + assertThat(rs.getLongArray(9)).isEqualTo(longArray); + assertThat(rs.getLongArray("longArray")).isEqualTo(longArray); + assertThat(rs.getLongList(9)).isEqualTo(Longs.asList(longArray)); + assertThat(rs.getLongList("longArray")).isEqualTo(Longs.asList(longArray)); + assertThat(rs.getDoubleArray(10)).isEqualTo(doubleArray, 0.0); + assertThat(rs.getDoubleArray("doubleArray")).isEqualTo(doubleArray, 0.0); + assertThat(rs.getDoubleList(10)).isEqualTo(Doubles.asList(doubleArray)); + assertThat(rs.getDoubleList("doubleArray")).isEqualTo(Doubles.asList(doubleArray)); + assertThat(rs.getBytesList(11)).isEqualTo(Arrays.asList(byteArray)); + assertThat(rs.getBytesList("byteArray")).isEqualTo(Arrays.asList(byteArray)); + assertThat(rs.getTimestampList(12)).isEqualTo(Arrays.asList(timestampArray)); + assertThat(rs.getTimestampList("timestampArray")).isEqualTo(Arrays.asList(timestampArray)); + assertThat(rs.getDateList(13)).isEqualTo(Arrays.asList(dateArray)); + assertThat(rs.getDateList("dateArray")).isEqualTo(Arrays.asList(dateArray)); + assertThat(rs.getStringList(14)).isEqualTo(Arrays.asList(stringArray)); + assertThat(rs.getStringList("stringArray")).isEqualTo(Arrays.asList(stringArray)); assertThat(rs.next()).isTrue(); assertThat(rs.getCurrentRowAsStruct()).isEqualTo(struct2); From 64dbf566729e9f19d8f99c0d09688e18f12f64ff Mon Sep 17 00:00:00 2001 From: Nithin Nayak Sujir Date: Mon, 24 Sep 2018 13:21:37 -0700 Subject: [PATCH 3/3] ts -> timestamp --- .../java/com/google/cloud/spanner/ResultSetsTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java b/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java index 238f8d4e5f87..c5830ab591d8 100644 --- a/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java +++ b/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/ResultSetsTest.java @@ -76,7 +76,7 @@ public void resultSetIteration() { Type.StructField.of("doubleVal", Type.float64()), Type.StructField.of("stringVal", Type.string()), Type.StructField.of("byteVal", Type.bytes()), - Type.StructField.of("ts", Type.timestamp()), + Type.StructField.of("timestamp", Type.timestamp()), Type.StructField.of("date", Type.date()), Type.StructField.of("boolArray", Type.array(Type.bool())), Type.StructField.of("longArray", Type.array(Type.int64())), @@ -100,7 +100,7 @@ public void resultSetIteration() { .to(stringVal) .set("byteVal") .to(Value.bytes(ByteArray.copyFrom(byteVal))) - .set("ts") + .set("timestamp") .to(Timestamp.ofTimeMicroseconds(usecs)) .set("date") .to(Date.fromYearMonthDay(year, month, day)) @@ -133,7 +133,7 @@ public void resultSetIteration() { .to(stringVal) .set("byteVal") .to(Value.bytes(ByteArray.copyFrom(byteVal))) - .set("ts") + .set("timestamp") .to(Timestamp.ofTimeMicroseconds(usecs)) .set("date") .to(Date.fromYearMonthDay(year, month, day)) @@ -187,7 +187,7 @@ public void resultSetIteration() { assertThat(rs.getBytes(5)).isEqualTo(ByteArray.copyFrom(byteVal)); assertThat(rs.getBytes("byteVal")).isEqualTo(ByteArray.copyFrom(byteVal)); assertThat(rs.getTimestamp(6)).isEqualTo(Timestamp.ofTimeMicroseconds(usecs)); - assertThat(rs.getTimestamp("ts")).isEqualTo(Timestamp.ofTimeMicroseconds(usecs)); + assertThat(rs.getTimestamp("timestamp")).isEqualTo(Timestamp.ofTimeMicroseconds(usecs)); assertThat(rs.getDate(7)).isEqualTo(Date.fromYearMonthDay(year, month, day)); assertThat(rs.getDate("date")).isEqualTo(Date.fromYearMonthDay(year, month, day)); assertThat(rs.getBooleanArray(8)).isEqualTo(boolArray);