From 1c0861dacbbe54a8db93e29aabddbcee4f13c4dc Mon Sep 17 00:00:00 2001 From: jeremyhi Date: Tue, 30 Jan 2024 14:31:58 +0800 Subject: [PATCH] feat: remove duration types --- .../src/main/java/io/greptime/models/DataType.java | 12 ------------ .../src/main/java/io/greptime/models/RowHelper.java | 12 ------------ .../src/test/java/io/greptime/WriteClientTest.java | 1 - 3 files changed, 25 deletions(-) diff --git a/ingester-protocol/src/main/java/io/greptime/models/DataType.java b/ingester-protocol/src/main/java/io/greptime/models/DataType.java index d0e80fa..41e43e9 100644 --- a/ingester-protocol/src/main/java/io/greptime/models/DataType.java +++ b/ingester-protocol/src/main/java/io/greptime/models/DataType.java @@ -50,10 +50,6 @@ public enum DataType { IntervalYearMonth, // IntervalDayTime, // IntervalMonthDayNano, // - DurationSecond, // - DurationMillisecond, // - DurationMicrosecond, // - DurationNanosecond, // Decimal128, // ; @@ -111,14 +107,6 @@ public Common.ColumnDataType toProtoValue() { return Common.ColumnDataType.INTERVAL_DAY_TIME; case IntervalMonthDayNano: return Common.ColumnDataType.INTERVAL_MONTH_DAY_NANO; - case DurationSecond: - return Common.ColumnDataType.DURATION_SECOND; - case DurationMillisecond: - return Common.ColumnDataType.DURATION_MILLISECOND; - case DurationMicrosecond: - return Common.ColumnDataType.DURATION_MICROSECOND; - case DurationNanosecond: - return Common.ColumnDataType.DURATION_NANOSECOND; case Decimal128: return Common.ColumnDataType.DECIMAL128; default: diff --git a/ingester-protocol/src/main/java/io/greptime/models/RowHelper.java b/ingester-protocol/src/main/java/io/greptime/models/RowHelper.java index 5f977fc..9f7ef9f 100644 --- a/ingester-protocol/src/main/java/io/greptime/models/RowHelper.java +++ b/ingester-protocol/src/main/java/io/greptime/models/RowHelper.java @@ -112,18 +112,6 @@ public static void addValue(RowData.Row.Builder builder, // case INTERVAL_MONTH_DAY_NANO: valueBuilder.setIntervalMonthDayNanoValue(Util.getIntervalMonthDayNanoValue(value)); break; - case DURATION_SECOND: - valueBuilder.setDurationSecondValue(Util.getLongValue(value)); - break; - case DURATION_MILLISECOND: - valueBuilder.setDurationMillisecondValue(Util.getLongValue(value)); - break; - case DURATION_MICROSECOND: - valueBuilder.setDurationMicrosecondValue(Util.getLongValue(value)); - break; - case DURATION_NANOSECOND: - valueBuilder.setDurationNanosecondValue(Util.getLongValue(value)); - break; case DECIMAL128: valueBuilder.setDecimal128Value(Util.getDecimal128Value(dataTypeExtension, value)); break; diff --git a/ingester-protocol/src/test/java/io/greptime/WriteClientTest.java b/ingester-protocol/src/test/java/io/greptime/WriteClientTest.java index 09eaa3b..d7b833b 100644 --- a/ingester-protocol/src/test/java/io/greptime/WriteClientTest.java +++ b/ingester-protocol/src/test/java/io/greptime/WriteClientTest.java @@ -33,7 +33,6 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.runners.MockitoJUnitRunner; -import java.util.Collections; import java.util.concurrent.ExecutionException; import java.util.concurrent.ForkJoinPool; import static io.greptime.models.SemanticType.Field;