diff --git a/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/FloatColumn.java b/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/FloatColumn.java index 98bcd90e..c008d935 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/FloatColumn.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/FloatColumn.java @@ -34,6 +34,7 @@ import static org.apache.tsfile.utils.RamUsageEstimator.sizeOfBooleanArray; import static org.apache.tsfile.utils.RamUsageEstimator.sizeOfFloatArray; +@SuppressWarnings("java:S3012") public class FloatColumn implements Column { private static final int INSTANCE_SIZE = @@ -94,11 +95,25 @@ public float getFloat(int position) { return values[position + arrayOffset]; } + @Override + public double getDouble(int position) { + return values[position + arrayOffset]; + } + @Override public float[] getFloats() { return values; } + @Override + public double[] getDoubles() { + double[] doubles = new double[values.length]; + for (int i = 0; i < values.length; i++) { + doubles[i] = values[i]; + } + return doubles; + } + @Override public Object getObject(int position) { return getFloat(position); diff --git a/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/IntColumn.java b/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/IntColumn.java index 3e0caa91..c2065ee3 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/IntColumn.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/IntColumn.java @@ -34,6 +34,7 @@ import static org.apache.tsfile.utils.RamUsageEstimator.sizeOfBooleanArray; import static org.apache.tsfile.utils.RamUsageEstimator.sizeOfIntArray; +@SuppressWarnings("java:S3012") public class IntColumn implements Column { private static final int INSTANCE_SIZE = @@ -94,11 +95,53 @@ public int getInt(int position) { return values[position + arrayOffset]; } + @Override + public long getLong(int position) { + return values[position + arrayOffset]; + } + + @Override + public float getFloat(int position) { + return values[position + arrayOffset]; + } + + @Override + public double getDouble(int position) { + return values[position + arrayOffset]; + } + @Override public int[] getInts() { return values; } + @Override + public float[] getFloats() { + float[] result = new float[values.length]; + for (int i = 0; i < values.length; i++) { + result[i] = values[i]; + } + return result; + } + + @Override + public long[] getLongs() { + long[] result = new long[values.length]; + for (int i = 0; i < values.length; i++) { + result[i] = values[i]; + } + return result; + } + + @Override + public double[] getDoubles() { + double[] result = new double[values.length]; + for (int i = 0; i < values.length; i++) { + result[i] = values[i]; + } + return result; + } + @Override public Object getObject(int position) { return getInt(position); diff --git a/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/LongColumn.java b/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/LongColumn.java index bbbb0663..ecba9013 100644 --- a/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/LongColumn.java +++ b/java/tsfile/src/main/java/org/apache/tsfile/read/common/block/column/LongColumn.java @@ -34,6 +34,7 @@ import static org.apache.tsfile.utils.RamUsageEstimator.sizeOfBooleanArray; import static org.apache.tsfile.utils.RamUsageEstimator.sizeOfLongArray; +@SuppressWarnings("java:S3012") public class LongColumn implements Column { private static final int INSTANCE_SIZE = @@ -94,11 +95,25 @@ public long getLong(int position) { return values[position + arrayOffset]; } + @Override + public double getDouble(int position) { + return values[position + arrayOffset]; + } + @Override public long[] getLongs() { return values; } + @Override + public double[] getDoubles() { + double[] doubles = new double[values.length]; + for (int i = 0; i < values.length; i++) { + doubles[i] = values[i]; + } + return doubles; + } + @Override public Object getObject(int position) { return getLong(position);