This is an automated email from the ASF dual-hosted git repository.
shuwenwei pushed a commit to branch read_tsfile_table_function
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/read_tsfile_table_function by
this push:
new 2be51e712a0 fix
2be51e712a0 is described below
commit 2be51e712a019b00efb5702bf339ce3a50ca1cfc
Author: shuwenwei <[email protected]>
AuthorDate: Tue Jun 16 15:26:10 2026 +0800
fix
---
.../db/queryengine/common/MPPQueryContext.java | 4 +--
.../readTsFile/ExternalTsFileQueryResource.java | 40 ++++------------------
.../ExternalTsFileQueryResourceTest.java | 2 +-
pom.xml | 2 +-
4 files changed, 10 insertions(+), 38 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/MPPQueryContext.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/MPPQueryContext.java
index a19e72f41dd..6ec9fca5946 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/MPPQueryContext.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/MPPQueryContext.java
@@ -269,9 +269,7 @@ public class MPPQueryContext implements IAuditEntity {
.resolve(queryId.getId())
.resolve(String.valueOf(externalTsFileQueryResources.size())),
tableName,
- tsFilePaths,
- ignored -> {},
- true);
+ tsFilePaths);
externalTsFileQueryResources.add(externalTsFileQueryResource);
return externalTsFileQueryResource;
}
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ExternalTsFileQueryResource.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ExternalTsFileQueryResource.java
index 0d81d36ae37..56eaed315ac 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ExternalTsFileQueryResource.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ExternalTsFileQueryResource.java
@@ -64,7 +64,6 @@ import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Queue;
-import java.util.function.LongConsumer;
import static java.util.Objects.requireNonNull;
@@ -89,7 +88,6 @@ public class ExternalTsFileQueryResource implements
AutoCloseable {
private final String tableName;
private final List<String> tsFilePaths;
private final List<TsFileResource> sharedTsFileResources;
- private final LongConsumer ioSizeRecorder;
private final List<DeviceEntry> sharedDeviceEntries = new ArrayList<>();
private final List<DeviceTaskPartition> deviceTaskPartitions = new
ArrayList<>();
private Comparator<DeviceEntry> deviceEntryComparator;
@@ -97,25 +95,15 @@ public class ExternalTsFileQueryResource implements
AutoCloseable {
private volatile boolean closed;
public ExternalTsFileQueryResource(
- MPPQueryContext queryContext,
- Path tempRoot,
- String tableName,
- List<String> tsFilePaths,
- LongConsumer ioSizeRecorder,
- boolean useExactTempRoot) {
+ MPPQueryContext queryContext, Path tempRoot, String tableName,
List<String> tsFilePaths) {
this.queryId = requireNonNull(queryContext, "queryContext is
null").getQueryId();
this.externalTsFileResourceMemoryReservationManager =
new NotThreadSafeMemoryReservationManager(
queryId, ExternalTsFileQueryResource.class.getName());
- this.queryTempRoot =
- useExactTempRoot
- ? requireNonNull(tempRoot, "tempRoot is null")
- : requireNonNull(tempRoot, "tempRoot is
null").resolve(this.queryId.getId());
+ this.queryTempRoot = requireNonNull(tempRoot, "tempRoot is null");
this.tableName = tableName;
- this.tsFilePaths =
- Collections.unmodifiableList(new
ArrayList<>(requireNonNull(tsFilePaths, "tsFilePaths")));
+ this.tsFilePaths = requireNonNull(tsFilePaths, "tsFilePaths");
this.sharedTsFileResources = createTsFileResources(this.tsFilePaths);
- this.ioSizeRecorder = requireNonNull(ioSizeRecorder, "ioSizeRecorder is
null");
for (String tsFilePath : tsFilePaths) {
FileReaderManager.getInstance().increaseExternalFileReaderReference(tsFilePath);
}
@@ -124,7 +112,7 @@ public class ExternalTsFileQueryResource implements
AutoCloseable {
public void collectDeviceEntries(
SchemaFilter schemaFilter, Comparator<DeviceEntry> comparator, int
partitionCount) {
checkNotClosed();
- deviceEntryComparator = comparator;
+ this.deviceEntryComparator = comparator;
acquireMemoryForTsFileReaders();
ExternalTsFileDeviceFilterVisitor deviceFilterVisitor = new
ExternalTsFileDeviceFilterVisitor();
try (DeviceCollector deviceCollector = new DeviceCollector()) {
@@ -235,20 +223,7 @@ public class ExternalTsFileQueryResource implements
AutoCloseable {
for (String tsFilePath : tsFilePaths) {
TsFileResource resource =
new TsFileResource(new File(tsFilePath),
TsFileResourceStatus.NORMAL);
- if (resource.resourceFileExists()) {
- try {
- resource.deserialize();
- } catch (IOException e) {
- throw new RuntimeException(
- String.format(
-
DataNodeQueryMessages.FAILED_TO_DESERIALIZE_EXTERNAL_TSFILE_RESOURCE,
- tsFilePath,
- e.getMessage()),
- e);
- }
- } else {
- resource.setTimeIndex(new FileTimeIndex(Long.MIN_VALUE,
Long.MAX_VALUE));
- }
+ resource.setTimeIndex(new FileTimeIndex(Long.MIN_VALUE, Long.MAX_VALUE));
tsFileResources.add(resource);
}
return Collections.unmodifiableList(tsFileResources);
@@ -641,9 +616,8 @@ public class ExternalTsFileQueryResource implements
AutoCloseable {
for (int fileIndex = 0; fileIndex < tsFilePaths.size(); fileIndex++) {
TsFileSequenceReader reader =
FileReaderManager.getInstance()
- .get(tsFilePaths.get(fileIndex), null, true, ioSizeRecorder,
true);
- deviceIteratorMap.put(
- fileIndex, new LazyTsFileDeviceIterator(reader, tableName,
ioSizeRecorder));
+ .get(tsFilePaths.get(fileIndex), null, true, null, true);
+ deviceIteratorMap.put(fileIndex, new
LazyTsFileDeviceIterator(reader, tableName, null));
}
} catch (IOException e) {
close();
diff --git
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ExternalTsFileQueryResourceTest.java
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ExternalTsFileQueryResourceTest.java
index c1db965364d..ed9edf146f3 100644
---
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ExternalTsFileQueryResourceTest.java
+++
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ExternalTsFileQueryResourceTest.java
@@ -151,7 +151,7 @@ public class ExternalTsFileQueryResourceTest {
}
MPPQueryContext queryContext = new MPPQueryContext(new QueryId(queryId));
return new ExternalTsFileQueryResource(
- queryContext, root.toPath().resolve("tmp"), "table1", tsFilePaths,
ignored -> {}, true);
+ queryContext, root.toPath().resolve("tmp"), "table1", tsFilePaths);
}
private void addDevices(String... deviceNames) {
diff --git a/pom.xml b/pom.xml
index c577243cb0a..096536c706a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -151,7 +151,7 @@
<thrift.version>0.14.1</thrift.version>
<xz.version>1.9</xz.version>
<zstd-jni.version>1.5.6-3</zstd-jni.version>
- <tsfile.version>2.3.2-260608-SNAPSHOT</tsfile.version>
+ <tsfile.version>2.3.2-260616-SNAPSHOT</tsfile.version>
<i18n.locale>en</i18n.locale>
<tsfile.locale.opt/>
</properties>