You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tsfile.apache.org by co...@apache.org on 2026/10/10 11:24:04 UTC
(tsfile) branch rc/2.5.0 updated: Revert "refactor: remove IDeviceID.isTableModel (#998)"
This is an automated email from the ASF dual-hosted git repository.
ColinLeeo pushed a commit to branch rc/2.5.0
in repository https://gitbox.apache.org/repos/asf/tsfile.git
The following commit(s) were added to refs/heads/rc/2.5.0 by this push:
new 1f4249a22 Revert "refactor: remove IDeviceID.isTableModel (#998)"
1f4249a22 is described below
commit 1f4249a22f8511eb99262c3b1812e2d516cfe7e4
Author: ColinLee <sh...@163.com>
AuthorDate: Sat Oct 10 19:23:54 2026 +0800
Revert "refactor: remove IDeviceID.isTableModel (#998)"
This reverts commit 1d87fe0b0636bf07f40e63167303c5e6208755fb.
Update 2.5.0 release notes to omit the reverted API removal and consolidate CLI fixes into the new CLI feature.
---
RELEASE_NOTES.md | 5 +----
.../main/java/org/apache/tsfile/file/metadata/IDeviceID.java | 2 ++
.../java/org/apache/tsfile/file/metadata/PlainDeviceID.java | 5 +++++
.../org/apache/tsfile/file/metadata/StringArrayDeviceID.java | 6 ++++++
.../java/org/apache/tsfile/write/writer/TsFileIOWriter.java | 4 ++--
.../java/org/apache/tsfile/file/metadata/IDeviceIDTest.java | 10 ++++++++++
6 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index eb3c9ad64..c29348d4a 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -30,7 +30,7 @@
- [C++/Python] Added seekable random-access data sources, including Python binary file objects and remote files opened through libraries such as `fsspec`. (#939)
- [C++/Python] Added an optional memory-mapped local file read backend with `PREAD`, `MMAP`, and `AUTO` modes. (#920)
- [C++] Added CHIMP, RLBE, and CAMEL encodings, Zstandard compression, and optional LZMA2 compression, with Java/C++ compatibility coverage. (#905)
-- [C++] Added `tsfile-cli`, a command-line tool for tree-model and table-model inspection, filtered reads, CSV/NDJSON export, CSV import, and physical file layout inspection with `sketch`. (#829, #915, #838)
+- [C++] Added `tsfile-cli`, a command-line tool for tree-model and table-model inspection, filtered reads, CSV/NDJSON export, CSV import, and physical file layout inspection with `sketch`. (#829, #838, #915, #994, #996, #997, #1002)
- [Tools] Added reusable agent skills for TsFile development and `tsfile-cli` workflows. (#907)
## Improvements
@@ -41,7 +41,6 @@
- [C++] Added static-library builds and configurable system or verified source-archive dependency sourcing, including offline builds from cached archives. (#894, #905)
- [Java] Added buffered input and configurable `TsFileInput` construction for readers. (#868, #869)
- [Java] Streamlined data-type handling, cached page-reader type services, and moved type dispatch outside batch read and write loops. (#872, #955, #963)
-- [Java] Removed the `IDeviceID.isTableModel()` method from the public device-ID interface. (#998)
- [Java] Reduced query merge overhead and boxing allocations with primitive long heaps and sets. (#906)
- [Java] Optimized small bitmaps with a long-backed implementation and added range-query APIs. (#871, #884)
- [Java] Added batched null writes and independent bitmap offsets to `ValuePageWriter` for efficient nullable-column writes. (#948)
@@ -66,8 +65,6 @@
- [Python] Fixed omitted BOOLEAN and TIMESTAMP dataset fields and preserved null field values during Arrow-to-NumPy conversion. (#935, #942)
- [Python] Fixed DataFrame subsets closing shared readers and guarded dataset-index access after close to prevent invalid reads and crashes. (#946, #999)
- [C++] Fixed double-free, memory-leak, and null-dereference paths in readers, compressors, Tablets, containers, and C API string getters. (#879, #881)
-- [C++] Fixed CSV import/export round trips to preserve leading backslashes and quoted line endings in text values. (#994, #996)
-- [C++] Fixed malformed UTF-8 handling in CLI output and rejected object or column names that collide after replacement, preventing ambiguous output and duplicate fields. (#997, #1002)
- [Java] Strengthened encryption metadata length and implementation-type validation while preserving compatibility with custom encryption implementations. (#925, #956)
# Apache TsFile 2.4.0
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/IDeviceID.java b/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/IDeviceID.java
index 85b90ccbe..d595ca659 100644
--- a/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/IDeviceID.java
+++ b/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/IDeviceID.java
@@ -46,6 +46,8 @@ public interface IDeviceID extends Comparable<IDeviceID>, Accountable, Serializa
boolean isEmpty();
+ boolean isTableModel();
+
/**
* @return the table name associated with the device. For a path-DeviceId, like "root.a.b.c.d", it
* is converted according to a fixed rule, like assuming the first three levels ("root.a.b")
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/PlainDeviceID.java b/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/PlainDeviceID.java
index cc93350f1..ccc8ce2c2 100644
--- a/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/PlainDeviceID.java
+++ b/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/PlainDeviceID.java
@@ -110,6 +110,11 @@ public class PlainDeviceID implements IDeviceID {
return deviceID.isEmpty();
}
+ @Override
+ public boolean isTableModel() {
+ return false;
+ }
+
@Override
public long ramBytesUsed() {
long size = INSTANCE_SIZE;
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/StringArrayDeviceID.java b/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/StringArrayDeviceID.java
index ce42cbd41..bc5233f08 100644
--- a/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/StringArrayDeviceID.java
+++ b/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/StringArrayDeviceID.java
@@ -37,6 +37,7 @@ import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Objects;
+import static org.apache.tsfile.common.constant.TsFileConstant.PATH_ROOT;
import static org.apache.tsfile.common.constant.TsFileConstant.PATH_SEPARATOR;
public class StringArrayDeviceID implements IDeviceID {
@@ -221,6 +222,11 @@ public class StringArrayDeviceID implements IDeviceID {
return segments == null || segments.length == 0;
}
+ @Override
+ public boolean isTableModel() {
+ return !segments[0].startsWith(PATH_ROOT + PATH_SEPARATOR);
+ }
+
@Override
public String toString() {
return String.join(PATH_SEPARATOR, segments);
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/write/writer/TsFileIOWriter.java b/java/tsfile/src/main/java/org/apache/tsfile/write/writer/TsFileIOWriter.java
index 5e1d33c21..93ddec569 100644
--- a/java/tsfile/src/main/java/org/apache/tsfile/write/writer/TsFileIOWriter.java
+++ b/java/tsfile/src/main/java/org/apache/tsfile/write/writer/TsFileIOWriter.java
@@ -447,7 +447,7 @@ public class TsFileIOWriter implements AutoCloseable {
chunkMetadataCount++;
if (recordTablePointCount
&& currentChunkGroupDeviceId != null
- && schema.getTableSchemaMap().containsKey(currentChunkGroupDeviceId.getTableName())
+ && currentChunkGroupDeviceId.isTableModel()
&& (currentChunkMetadata.getMask() & TsFileConstant.TIME_COLUMN_MASK) == 0) {
tablePointCountMap.merge(
currentChunkGroupDeviceId.getTableName(),
@@ -956,7 +956,7 @@ public class TsFileIOWriter implements AutoCloseable {
// endFile
boolean endFile = currentStartChunkGroupDeviceId == null;
if (endFile
- || (schema.getTableSchemaMap().containsKey(currentStartChunkGroupDeviceId.getTableName())
+ || (currentStartChunkGroupDeviceId.isTableModel()
&& !currentStartChunkGroupDeviceId.getTableName().equals(currentTable))) {
if (currentTable != null) {
long size = currentPosition - currentTableStartOffset;
diff --git a/java/tsfile/src/test/java/org/apache/tsfile/file/metadata/IDeviceIDTest.java b/java/tsfile/src/test/java/org/apache/tsfile/file/metadata/IDeviceIDTest.java
index 29c8dd7f2..0fc02aa7f 100644
--- a/java/tsfile/src/test/java/org/apache/tsfile/file/metadata/IDeviceIDTest.java
+++ b/java/tsfile/src/test/java/org/apache/tsfile/file/metadata/IDeviceIDTest.java
@@ -63,6 +63,16 @@ public class IDeviceIDTest {
assertTrue(deviceID.startWith("root.a"));
}
+ @Test
+ public void testIsTableModel() {
+ IDeviceID deviceID = Factory.DEFAULT_FACTORY.create("root.a.b.c.d");
+ assertFalse(deviceID.isTableModel());
+ deviceID = Factory.DEFAULT_FACTORY.create("root.b.c");
+ assertFalse(deviceID.isTableModel());
+ deviceID = Factory.DEFAULT_FACTORY.create("roota.b.c.d");
+ assertTrue(deviceID.isTableModel());
+ }
+
@Test
public void testMatchDatabaseName() {
IDeviceID deviceID = Factory.DEFAULT_FACTORY.create("root.a.b.c.d");