You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/11/15 10:25:39 UTC
[GitHub] [iotdb] choubenson opened a new pull request #4390: [IOTDB-1926]TsFile API supports query on aligned timeseries
choubenson opened a new pull request #4390:
URL: https://github.com/apache/iotdb/pull/4390
TsFile Api supports query on aligned timeseries, which also support value filter on aligned timeseries when querying.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] coveralls edited a comment on pull request #4390: [IOTDB-1926]TsFile API supports query on aligned timeseries
Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4390:
URL: https://github.com/apache/iotdb/pull/4390#issuecomment-971147581
[](https://coveralls.io/builds/44398838)
Coverage increased (+0.008%) to 66.897% when pulling **efc12cf41f0ae5f6931441b319c39891f04204f2 on choubenson:new_vector** into **d63539b7ec78576b12484a731ac3ff2894f922ed on apache:master**.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] coveralls edited a comment on pull request #4390: [IOTDB-1926]TsFile API supports query on aligned timeseries
Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4390:
URL: https://github.com/apache/iotdb/pull/4390#issuecomment-971147581
[](https://coveralls.io/builds/44372612)
Coverage increased (+0.3%) to 66.761% when pulling **d6d05412dff9d23404dc6869177b213590fa9829 on choubenson:new_vector** into **96df1861643aa7f8f72d1bb276569d0eb68ee901 on apache:master**.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] coveralls edited a comment on pull request #4390: [IOTDB-1926]TsFile API supports query on aligned timeseries
Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4390:
URL: https://github.com/apache/iotdb/pull/4390#issuecomment-971147581
[](https://coveralls.io/builds/44361053)
Coverage increased (+0.1%) to 66.609% when pulling **14830728c69e922db120653f7f9cc4554283f431 on choubenson:new_vector** into **96df1861643aa7f8f72d1bb276569d0eb68ee901 on apache:master**.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] coveralls commented on pull request #4390: [IOTDB-1926]TsFile API supports query on aligned timeseries
Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #4390:
URL: https://github.com/apache/iotdb/pull/4390#issuecomment-971147581
[](https://coveralls.io/builds/44321997)
Coverage increased (+0.02%) to 66.58% when pulling **d0d73f8a824c9417f583817aea12f9e04d789055 on choubenson:new_vector** into **36a2c850f5191744a3c8577309389beb0ccaeb03 on apache:master**.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] JackieTien97 merged pull request #4390: [IOTDB-1926]TsFile API supports query on aligned timeseries
Posted by GitBox <gi...@apache.org>.
JackieTien97 merged pull request #4390:
URL: https://github.com/apache/iotdb/pull/4390
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] coveralls edited a comment on pull request #4390: [IOTDB-1926]TsFile API supports query on aligned timeseries
Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4390:
URL: https://github.com/apache/iotdb/pull/4390#issuecomment-971147581
[](https://coveralls.io/builds/44393441)
Coverage increased (+0.002%) to 66.891% when pulling **b5918edc17f883ec3408081449b5db7d482756b1 on choubenson:new_vector** into **d63539b7ec78576b12484a731ac3ff2894f922ed on apache:master**.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] qiaojialin commented on a change in pull request #4390: [IOTDB-1926]TsFile API supports query on aligned timeseries
Posted by GitBox <gi...@apache.org>.
qiaojialin commented on a change in pull request #4390:
URL: https://github.com/apache/iotdb/pull/4390#discussion_r749842016
##########
File path: example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileRead.java
##########
@@ -40,55 +41,55 @@
*/
public class TsFileRead {
- private static final String DEVICE1 = "device_1";
+ private static final String DEVICE1 = "root.sg.d1";
private static void queryAndPrint(
- ArrayList<Path> paths, ReadOnlyTsFile readTsFile, IExpression statement) throws IOException {
+ ArrayList<Path> paths, TsFileReader readTsFile, IExpression statement) throws IOException {
QueryExpression queryExpression = QueryExpression.create(paths, statement);
QueryDataSet queryDataSet = readTsFile.query(queryExpression);
while (queryDataSet.hasNext()) {
System.out.println(queryDataSet.next());
}
- System.out.println("------------");
+ System.out.println("----------------");
}
public static void main(String[] args) throws IOException {
- // file path
- String path = "test.tsfile";
+ // file path, the number of levels of the directory must be greater than 3
Review comment:
what's this for?
##########
File path: example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileWriteAlignedWithTSRecord.java
##########
@@ -56,7 +56,7 @@ public static void main(String[] args) throws IOException {
writeMeasurementScheams.add(measurementSchemas.get(0));
writeMeasurementScheams.add(measurementSchemas.get(1));
writeMeasurementScheams.add(measurementSchemas.get(2));
- writeAligned(tsFileWriter, "root.sg.d1", writeMeasurementScheams, 1000000, 0, 0);
+ writeAligned(tsFileWriter, "root.sg.d1", writeMeasurementScheams, 100000, 0, 0);
Review comment:
why change this?
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/TsFileSequenceReader.java
##########
@@ -327,7 +329,7 @@ public BloomFilter readBloomFilter() throws IOException {
return deviceMetadata;
}
- public TimeseriesMetadata readTimeseriesMetadata(Path path, boolean ignoreNotExists)
+ public ITimeSeriesMetadata readTimeseriesMetadata(Path path, boolean ignoreNotExists)
Review comment:
this method is used by the server, where we know whether the timeseries are aligned or not. So no need to change this method you could write a new method (readITimeseriesMetadata) for TsFile API.
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/AlignedTimeSeriesMetadata.java
##########
@@ -112,6 +112,9 @@ public void setSeq(boolean seq) {
// only at least one sensor exits, we add the AlignedChunkMetadata to the list
boolean exits = false;
for (List<IChunkMetadata> chunkMetadata : valueChunkMetadataList) {
+ if (i >= chunkMetadata.size()) { // there may be fewer value chunks than time chunks
Review comment:
no need
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] coveralls edited a comment on pull request #4390: [IOTDB-1926]TsFile API supports query on aligned timeseries
Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4390:
URL: https://github.com/apache/iotdb/pull/4390#issuecomment-971147581
[](https://coveralls.io/builds/44323023)
Coverage increased (+0.02%) to 66.523% when pulling **49cf67d052303cca0d79509b2044c01fbcbb9568 on choubenson:new_vector** into **96df1861643aa7f8f72d1bb276569d0eb68ee901 on apache:master**.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] JackieTien97 commented on a change in pull request #4390: [IOTDB-1926]TsFile API supports query on aligned timeseries
Posted by GitBox <gi...@apache.org>.
JackieTien97 commented on a change in pull request #4390:
URL: https://github.com/apache/iotdb/pull/4390#discussion_r750122336
##########
File path: example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileRead.java
##########
@@ -40,55 +41,55 @@
*/
public class TsFileRead {
- private static final String DEVICE1 = "device_1";
+ private static final String DEVICE1 = "root.sg.d1";
private static void queryAndPrint(
- ArrayList<Path> paths, ReadOnlyTsFile readTsFile, IExpression statement) throws IOException {
+ ArrayList<Path> paths, TsFileReader readTsFile, IExpression statement) throws IOException {
QueryExpression queryExpression = QueryExpression.create(paths, statement);
QueryDataSet queryDataSet = readTsFile.query(queryExpression);
while (queryDataSet.hasNext()) {
System.out.println(queryDataSet.next());
}
- System.out.println("------------");
+ System.out.println("----------------");
}
public static void main(String[] args) throws IOException {
- // file path
- String path = "test.tsfile";
+ // file path, the number of levels of the directory must be greater than 3
+ String path = "alignedTablet.tsfile";
// create reader and get the readTsFile interface
try (TsFileSequenceReader reader = new TsFileSequenceReader(path);
- ReadOnlyTsFile readTsFile = new ReadOnlyTsFile(reader)) {
+ TsFileReader readTsFile = new TsFileReader(reader)) {
// use these paths(all measurements) for all the queries
ArrayList<Path> paths = new ArrayList<>();
- paths.add(new Path(DEVICE1, "sensor_1"));
- paths.add(new Path(DEVICE1, "sensor_2"));
- paths.add(new Path(DEVICE1, "sensor_3"));
+ paths.add(new Path(DEVICE1, "s1"));
+ paths.add(new Path(DEVICE1, "s2"));
+ paths.add(new Path(DEVICE1, "s3"));
// no filter, should select 1 2 3 4 6 7 8
queryAndPrint(paths, readTsFile, null);
// time filter : 4 <= time <= 10, should select 4 6 7 8
IExpression timeFilter =
BinaryExpression.and(
- new GlobalTimeExpression(TimeFilter.gtEq(4L)),
- new GlobalTimeExpression(TimeFilter.ltEq(10L)));
+ new GlobalTimeExpression(TimeFilter.gtEq(29990L)),
+ new GlobalTimeExpression(TimeFilter.ltEq(30009L)));
queryAndPrint(paths, readTsFile, timeFilter);
// value filter : device_1.sensor_2 <= 20, should select 1 2 4 6 7
Review comment:
change it
##########
File path: example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileRead.java
##########
@@ -40,55 +41,55 @@
*/
public class TsFileRead {
- private static final String DEVICE1 = "device_1";
+ private static final String DEVICE1 = "root.sg.d1";
private static void queryAndPrint(
- ArrayList<Path> paths, ReadOnlyTsFile readTsFile, IExpression statement) throws IOException {
+ ArrayList<Path> paths, TsFileReader readTsFile, IExpression statement) throws IOException {
QueryExpression queryExpression = QueryExpression.create(paths, statement);
QueryDataSet queryDataSet = readTsFile.query(queryExpression);
while (queryDataSet.hasNext()) {
System.out.println(queryDataSet.next());
}
- System.out.println("------------");
+ System.out.println("----------------");
}
public static void main(String[] args) throws IOException {
- // file path
- String path = "test.tsfile";
+ // file path, the number of levels of the directory must be greater than 3
+ String path = "alignedTablet.tsfile";
// create reader and get the readTsFile interface
try (TsFileSequenceReader reader = new TsFileSequenceReader(path);
- ReadOnlyTsFile readTsFile = new ReadOnlyTsFile(reader)) {
+ TsFileReader readTsFile = new TsFileReader(reader)) {
// use these paths(all measurements) for all the queries
ArrayList<Path> paths = new ArrayList<>();
- paths.add(new Path(DEVICE1, "sensor_1"));
- paths.add(new Path(DEVICE1, "sensor_2"));
- paths.add(new Path(DEVICE1, "sensor_3"));
+ paths.add(new Path(DEVICE1, "s1"));
+ paths.add(new Path(DEVICE1, "s2"));
+ paths.add(new Path(DEVICE1, "s3"));
// no filter, should select 1 2 3 4 6 7 8
queryAndPrint(paths, readTsFile, null);
// time filter : 4 <= time <= 10, should select 4 6 7 8
IExpression timeFilter =
BinaryExpression.and(
- new GlobalTimeExpression(TimeFilter.gtEq(4L)),
- new GlobalTimeExpression(TimeFilter.ltEq(10L)));
+ new GlobalTimeExpression(TimeFilter.gtEq(29990L)),
+ new GlobalTimeExpression(TimeFilter.ltEq(30009L)));
queryAndPrint(paths, readTsFile, timeFilter);
// value filter : device_1.sensor_2 <= 20, should select 1 2 4 6 7
IExpression valueFilter =
- new SingleSeriesExpression(new Path(DEVICE1, "sensor_2"), ValueFilter.ltEq(20L));
+ new SingleSeriesExpression(new Path(DEVICE1, "s1"), ValueFilter.eq(new Long(3)));
queryAndPrint(paths, readTsFile, valueFilter);
// time filter : 4 <= time <= 10, value filter : device_1.sensor_3 >= 20, should select 4 7 8
Review comment:
change it
##########
File path: example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileRead.java
##########
@@ -40,55 +41,55 @@
*/
public class TsFileRead {
- private static final String DEVICE1 = "device_1";
+ private static final String DEVICE1 = "root.sg.d1";
private static void queryAndPrint(
- ArrayList<Path> paths, ReadOnlyTsFile readTsFile, IExpression statement) throws IOException {
+ ArrayList<Path> paths, TsFileReader readTsFile, IExpression statement) throws IOException {
QueryExpression queryExpression = QueryExpression.create(paths, statement);
QueryDataSet queryDataSet = readTsFile.query(queryExpression);
while (queryDataSet.hasNext()) {
System.out.println(queryDataSet.next());
}
- System.out.println("------------");
+ System.out.println("----------------");
}
public static void main(String[] args) throws IOException {
- // file path
- String path = "test.tsfile";
+ // file path, the number of levels of the directory must be greater than 3
+ String path = "alignedTablet.tsfile";
// create reader and get the readTsFile interface
try (TsFileSequenceReader reader = new TsFileSequenceReader(path);
- ReadOnlyTsFile readTsFile = new ReadOnlyTsFile(reader)) {
+ TsFileReader readTsFile = new TsFileReader(reader)) {
// use these paths(all measurements) for all the queries
ArrayList<Path> paths = new ArrayList<>();
- paths.add(new Path(DEVICE1, "sensor_1"));
- paths.add(new Path(DEVICE1, "sensor_2"));
- paths.add(new Path(DEVICE1, "sensor_3"));
+ paths.add(new Path(DEVICE1, "s1"));
+ paths.add(new Path(DEVICE1, "s2"));
+ paths.add(new Path(DEVICE1, "s3"));
// no filter, should select 1 2 3 4 6 7 8
queryAndPrint(paths, readTsFile, null);
// time filter : 4 <= time <= 10, should select 4 6 7 8
Review comment:
change it
##########
File path: example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileRead.java
##########
@@ -40,55 +41,55 @@
*/
public class TsFileRead {
- private static final String DEVICE1 = "device_1";
+ private static final String DEVICE1 = "root.sg.d1";
private static void queryAndPrint(
- ArrayList<Path> paths, ReadOnlyTsFile readTsFile, IExpression statement) throws IOException {
+ ArrayList<Path> paths, TsFileReader readTsFile, IExpression statement) throws IOException {
QueryExpression queryExpression = QueryExpression.create(paths, statement);
QueryDataSet queryDataSet = readTsFile.query(queryExpression);
while (queryDataSet.hasNext()) {
System.out.println(queryDataSet.next());
}
- System.out.println("------------");
+ System.out.println("----------------");
}
public static void main(String[] args) throws IOException {
- // file path
- String path = "test.tsfile";
+ // file path, the number of levels of the directory must be greater than 3
+ String path = "alignedTablet.tsfile";
// create reader and get the readTsFile interface
try (TsFileSequenceReader reader = new TsFileSequenceReader(path);
- ReadOnlyTsFile readTsFile = new ReadOnlyTsFile(reader)) {
+ TsFileReader readTsFile = new TsFileReader(reader)) {
// use these paths(all measurements) for all the queries
ArrayList<Path> paths = new ArrayList<>();
- paths.add(new Path(DEVICE1, "sensor_1"));
- paths.add(new Path(DEVICE1, "sensor_2"));
- paths.add(new Path(DEVICE1, "sensor_3"));
+ paths.add(new Path(DEVICE1, "s1"));
+ paths.add(new Path(DEVICE1, "s2"));
+ paths.add(new Path(DEVICE1, "s3"));
// no filter, should select 1 2 3 4 6 7 8
queryAndPrint(paths, readTsFile, null);
// time filter : 4 <= time <= 10, should select 4 6 7 8
IExpression timeFilter =
BinaryExpression.and(
- new GlobalTimeExpression(TimeFilter.gtEq(4L)),
- new GlobalTimeExpression(TimeFilter.ltEq(10L)));
+ new GlobalTimeExpression(TimeFilter.gtEq(29990L)),
+ new GlobalTimeExpression(TimeFilter.ltEq(30009L)));
queryAndPrint(paths, readTsFile, timeFilter);
// value filter : device_1.sensor_2 <= 20, should select 1 2 4 6 7
IExpression valueFilter =
- new SingleSeriesExpression(new Path(DEVICE1, "sensor_2"), ValueFilter.ltEq(20L));
+ new SingleSeriesExpression(new Path(DEVICE1, "s1"), ValueFilter.eq(new Long(3)));
Review comment:
Maybe try `s1`, `s2` and `s3` as before will better.
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Gt.java
##########
@@ -45,7 +45,9 @@ public boolean satisfy(Statistics statistics) {
if (filterType == FilterType.TIME_FILTER) {
return ((Long) value) < statistics.getEndTime();
} else {
- if (statistics.getType() == TSDataType.TEXT || statistics.getType() == TSDataType.BOOLEAN) {
+ if (statistics.getType() == TSDataType.TEXT
+ || statistics.getType() == TSDataType.BOOLEAN
+ || statistics.getType() == TSDataType.VECTOR) {
Review comment:
delete
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Eq.java
##########
@@ -46,7 +46,9 @@ public boolean satisfy(Statistics statistics) {
return ((Long) value) >= statistics.getStartTime()
&& ((Long) value) <= statistics.getEndTime();
} else {
- if (statistics.getType() == TSDataType.TEXT || statistics.getType() == TSDataType.BOOLEAN) {
+ if (statistics.getType() == TSDataType.TEXT
+ || statistics.getType() == TSDataType.BOOLEAN
+ || statistics.getType() == TSDataType.VECTOR) {
Review comment:
delete
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/NotEq.java
##########
@@ -46,7 +46,9 @@ public boolean satisfy(Statistics statistics) {
return !(((Long) value) == statistics.getStartTime()
&& (Long) value == statistics.getEndTime());
} else {
- if (statistics.getType() == TSDataType.TEXT || statistics.getType() == TSDataType.BOOLEAN) {
+ if (statistics.getType() == TSDataType.TEXT
+ || statistics.getType() == TSDataType.BOOLEAN
+ || statistics.getType() == TSDataType.VECTOR) {
Review comment:
delete
##########
File path: example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileWriteAlignedWithTablet.java
##########
@@ -86,7 +86,7 @@ private static void writeAlignedWithTablet(
timestamps[row] = startTime++;
for (int i = 0; i < sensorNum; i++) {
Binary[] textSensor = (Binary[]) values[i];
- textSensor[row] = new Binary("testString.........");
+ textSensor[row] = new Binary("test");
Review comment:
What's wrong with the previous `testString.........`? Why we need to replace it.
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/query/executor/TsFileExecutor.java
##########
@@ -188,7 +189,15 @@ private QueryDataSet executeMayAttachTimeFiler(
seriesReader =
new FileSeriesReader(chunkLoader, chunkMetadataList, timeExpression.getFilter());
}
- dataTypes.add(chunkMetadataList.get(0).getDataType());
+ if (chunkMetadataList.get(0).getDataType() != TSDataType.VECTOR) {
+ dataTypes.add(chunkMetadataList.get(0).getDataType());
+ } else {
+ dataTypes.add(
+ ((AlignedChunkMetadata) chunkMetadataList.get(0))
+ .getValueChunkMetadataList()
+ .get(0)
+ .getDataType());
+ }
Review comment:
maybe deleted
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/chunk/AlignedChunkReader.java
##########
@@ -231,9 +232,14 @@ private void getPageInfo(
throws IOException {
pageInfo.pageHeader = pageHeader;
pageInfo.dataType = chunkHeader.getDataType();
+ if (pageHeader.getUncompressedSize() == 0) { // Empty Page
+ pageInfo.pageData = null;
+ pageInfo.decoder = null;
+ return;
+ }
+
Review comment:
maybe delete
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/query/executor/ExecutorWithTimeGenerator.java
##########
@@ -78,7 +79,15 @@ public DataSetWithTimeGenerator execute(QueryExpression queryExpression) throws
List<IChunkMetadata> chunkMetadataList = metadataQuerier.getChunkMetaDataList(selectedPath);
if (chunkMetadataList.size() != 0) {
- dataTypes.add(chunkMetadataList.get(0).getDataType());
+ if (chunkMetadataList.get(0).getDataType() != TSDataType.VECTOR) {
+ dataTypes.add(chunkMetadataList.get(0).getDataType());
+ } else {
+ dataTypes.add(
+ ((AlignedChunkMetadata) chunkMetadataList.get(0))
+ .getValueChunkMetadataList()
+ .get(0)
+ .getDataType());
+ }
Review comment:
maybe deleted
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/page/ValuePageReader.java
##########
@@ -194,6 +194,10 @@ public BatchData nextBatch(long[] timeBatch, boolean ascending, Filter filter) {
return valueBatch;
}
+ public PageHeader getPageHeader() {
+ return pageHeader;
+ }
+
Review comment:
maybe deleted
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/controller/MetadataQuerierByFileImpl.java
##########
@@ -98,59 +88,42 @@ public void loadChunkMetaDatas(List<Path> paths) throws IOException {
}
deviceMeasurementsMap.get(path.getDevice()).add(path.getMeasurement());
}
-
- Map<Path, List<ChunkMetadata>> tempChunkMetaDatas = new HashMap<>();
-
int count = 0;
boolean enough = false;
-
for (Map.Entry<String, Set<String>> deviceMeasurements : deviceMeasurementsMap.entrySet()) {
if (enough) {
break;
}
String selectedDevice = deviceMeasurements.getKey();
- // s1, s2, s3
Set<String> selectedMeasurements = deviceMeasurements.getValue();
List<String> devices = this.tsFileReader.getAllDevices();
String[] deviceNames = devices.toArray(new String[0]);
if (Arrays.binarySearch(deviceNames, selectedDevice) < 0) {
continue;
}
- List<TimeseriesMetadata> timeseriesMetaDataList =
+ List<ITimeSeriesMetadata> timeseriesMetaDataList =
tsFileReader.readTimeseriesMetadata(selectedDevice, selectedMeasurements);
- List<ChunkMetadata> chunkMetadataList = new ArrayList<>();
- for (TimeseriesMetadata timeseriesMetadata : timeseriesMetaDataList) {
- chunkMetadataList.addAll(tsFileReader.readChunkMetaDataList(timeseriesMetadata));
- }
- // d1
- for (ChunkMetadata chunkMetaData : chunkMetadataList) {
- String currentMeasurement = chunkMetaData.getMeasurementUid();
-
- // s1
- if (selectedMeasurements.contains(currentMeasurement)) {
-
- // d1.s1
- Path path = new Path(selectedDevice, currentMeasurement);
-
- // add into tempChunkMetaDatas
- if (!tempChunkMetaDatas.containsKey(path)) {
- tempChunkMetaDatas.put(path, new ArrayList<>());
- }
- tempChunkMetaDatas.get(path).add(chunkMetaData);
-
- // check cache size, stop when reading enough
- count++;
- if (count == CACHED_ENTRY_NUMBER) {
- enough = true;
- break;
- }
+ for (ITimeSeriesMetadata timeseriesMetadata : timeseriesMetaDataList) {
+ List<IChunkMetadata> chunkMetadataList =
+ tsFileReader.readIChunkMetaDataList(timeseriesMetadata);
+ String measurementId;
+ if (timeseriesMetadata instanceof AlignedTimeSeriesMetadata) {
+ measurementId =
+ ((AlignedTimeSeriesMetadata) timeseriesMetadata)
+ .getValueTimeseriesMetadataList()
+ .get(0)
+ .getMeasurementId();
+ } else {
+ measurementId = ((TimeseriesMetadata) timeseriesMetadata).getMeasurementId();
}
+ this.chunkMetaDataCache.put(new Path(selectedDevice, measurementId), chunkMetadataList);
+ count += chunkMetadataList.size();
+ }
+ if (count == CACHED_ENTRY_NUMBER) {
+ enough = true;
+ break;
Review comment:
romove it to above loop
##########
File path: example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileForceAppendWrite.java
##########
@@ -41,7 +41,7 @@
private static final Logger logger = LoggerFactory.getLogger(TsFileForceAppendWrite.class);
public static void main(String[] args) throws IOException {
- String path = "test.tsfile";
+ String path = "alignedTablet.tsfile";
Review comment:
Why this file name, the written data are not aligned.
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/GtEq.java
##########
@@ -45,7 +45,9 @@ public boolean satisfy(Statistics statistics) {
if (filterType == FilterType.TIME_FILTER) {
return ((Long) value) <= statistics.getEndTime();
} else {
- if (statistics.getType() == TSDataType.TEXT || statistics.getType() == TSDataType.BOOLEAN) {
+ if (statistics.getType() == TSDataType.TEXT
+ || statistics.getType() == TSDataType.BOOLEAN
+ || statistics.getType() == TSDataType.VECTOR) {
Review comment:
delete
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/LtEq.java
##########
@@ -45,7 +45,9 @@ public boolean satisfy(Statistics statistics) {
if (filterType == FilterType.TIME_FILTER) {
return ((Long) value) >= statistics.getStartTime();
} else {
- if (statistics.getType() == TSDataType.TEXT || statistics.getType() == TSDataType.BOOLEAN) {
+ if (statistics.getType() == TSDataType.TEXT
+ || statistics.getType() == TSDataType.BOOLEAN
+ || statistics.getType() == TSDataType.VECTOR) {
Review comment:
delete
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/page/AlignedPageReader.java
##########
@@ -79,6 +79,9 @@ public BatchData getAllSatisfiedPageData(boolean ascending) throws IOException {
// if the vector contains more than on sub sensor, the BatchData's DataType is Vector
List<TsPrimitiveType[]> valueBatchList = new ArrayList<>(valueCount);
for (ValuePageReader valuePageReader : valuePageReaderList) {
+ if (valuePageReader.getPageHeader().getUncompressedSize() == 0) { // Empty Page
+ return BatchDataFactory.createBatchData(TSDataType.VECTOR);
+ }
Review comment:
Maybe deleted
##########
File path: tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Lt.java
##########
@@ -45,7 +45,9 @@ public boolean satisfy(Statistics statistics) {
if (filterType == FilterType.TIME_FILTER) {
return ((Long) value) > statistics.getStartTime();
} else {
- if (statistics.getType() == TSDataType.TEXT || statistics.getType() == TSDataType.BOOLEAN) {
+ if (statistics.getType() == TSDataType.TEXT
+ || statistics.getType() == TSDataType.BOOLEAN
+ || statistics.getType() == TSDataType.VECTOR) {
Review comment:
delete
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org