Skip to content

Commit 522fab8

Browse files
committed
all tests passed
1 parent ae14fa4 commit 522fab8

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/DateCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,6 @@ private static int cqlDateToDaysSinceEpoch(long raw) {
157157
@NonNull
158158
@Override
159159
public Optional<Integer> serializedSize() {
160-
return Optional.of(8);
160+
return Optional.absent();
161161
}
162162
}

core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/TimeCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,6 @@ public LocalTime parse(@Nullable String value) {
118118
@NonNull
119119
@Override
120120
public Optional<Integer> serializedSize() {
121-
return Optional.of(8);
121+
return Optional.absent();
122122
}
123123
}

core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/VectorCodec.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@
2828
import com.datastax.oss.driver.shaded.guava.common.collect.Iterables;
2929
import edu.umd.cs.findbugs.annotations.NonNull;
3030
import edu.umd.cs.findbugs.annotations.Nullable;
31+
32+
import java.net.InetAddress;
3133
import java.nio.ByteBuffer;
34+
import java.time.Instant;
35+
import java.time.LocalDate;
36+
import java.time.LocalTime;
3237
import java.util.ArrayList;
3338
import java.util.Iterator;
3439
import java.util.List;
@@ -99,14 +104,9 @@ public CqlVector<SubtypeT> decode(
99104
public String format(CqlVector<SubtypeT> value) {
100105
if (value == null) return "NULL";
101106

102-
// if the subtype is a string, double quote
103-
if (!value.isEmpty() && value.iterator().next() instanceof String)
104-
return value.stream()
105-
.map(s -> (String) s)
106-
.map(s -> "\"" + s + "\"")
107-
.collect(Collectors.joining(", ", "[", "]"));
108-
109-
return Iterables.toString(value);
107+
return value.stream()
108+
.map(subtypeCodec::format)
109+
.collect(Collectors.joining(", ", "[", "]"));
110110
}
111111

112112
@Nullable

integration-tests/src/test/java/com/datastax/oss/driver/core/data/DataTypeIT.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,11 @@ public static Object[][] typeSamples() {
265265
UdtValue udtValue2 = udt.newValue(1, o[1]);
266266
samples.add(new Object[] {udt, udtValue2});
267267

268-
// vector of type
269-
CqlVector<?> vector = CqlVector.newInstance(o[1]);
270-
samples.add(new Object[] {DataTypes.vectorOf(dataType, 1), vector});
268+
if (CCM_RULE.getCassandraVersion().compareTo(Version.parse("5.0")) >= 0){
269+
// vector of type
270+
CqlVector<?> vector = CqlVector.newInstance(o[1]);
271+
samples.add(new Object[] {DataTypes.vectorOf(dataType, 1), vector});
272+
}
271273

272274
return samples.stream();
273275
})

0 commit comments

Comments
 (0)