jt2594838 commented on code in PR #588:
URL: https://github.com/apache/tsfile/pull/588#discussion_r2317578397
##########
java/tsfile/src/test/java/org/apache/tsfile/utils/TypeCastTest.java:
##########
@@ -46,7 +48,23 @@ public void testSingleCast() {
for (TSDataType to : dataTypes) {
Object src = genValue(from);
if (to.isCompatible(from)) {
- assertEquals(genValue(to), to.castFromSingleValue(from, src));
+ if (to == TSDataType.STRING || to == TSDataType.TEXT) {
+ if (from == TSDataType.DATE) {
+ assertEquals(
+ new Binary(
+
LocalDate.ofEpochDay(Long.parseLong(src.toString())).toString(),
Review Comment:
`src` should already be an int, so it is not necessary to use `toString` and
`parse`?
##########
java/common/src/main/java/org/apache/tsfile/enums/TSDataType.java:
##########
@@ -99,6 +100,15 @@ public enum TSDataType {
Set<TSDataType> textCompatibleTypes = new HashSet<>();
textCompatibleTypes.add(STRING);
+ // add
Review Comment:
remove this
##########
java/common/src/main/java/org/apache/tsfile/utils/Binary.java:
##########
@@ -47,6 +47,12 @@ public Binary(String s, Charset charset) {
this.values = (s == null) ? null : s.getBytes(charset);
}
+ public static void main(String[] args) {
+ Integer i = 1;
+ Binary a = new Binary(String.valueOf(i), StandardCharsets.UTF_8);
+ System.out.println(a);
+ }
Review Comment:
remove
##########
java/tsfile/src/main/java/org/apache/tsfile/file/metadata/statistics/Statistics.java:
##########
@@ -63,6 +66,35 @@ public abstract class Statistics<T extends Serializable> {
static final String STATS_UNSUPPORTED_MSG = "%s statistics does not support:
%s";
+ private static final Set<Pair<TSDataType, TSDataType>> CAN_NOT_MERGE_PAIRS;
Review Comment:
TsFile already has a `Pair` class, do not introduce new ones.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]