This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/tsfile.git
The following commit(s) were added to refs/heads/develop by this push:
new 6f1ccce7 Add constructor to TableSchema with pre-built schemas and
position index (#626)
6f1ccce7 is described below
commit 6f1ccce797c2cd4979e08709d9160fdd77281744
Author: Zhenyu Luo <[email protected]>
AuthorDate: Fri Nov 7 14:33:13 2025 +0800
Add constructor to TableSchema with pre-built schemas and position index
(#626)
* Add constructor to TableSchema with pre-built schemas and position index
* spotless
---
.../org/apache/tsfile/file/metadata/TableSchema.java | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git
a/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/TableSchema.java
b/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/TableSchema.java
index 70ddc690..6d630c38 100644
--- a/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/TableSchema.java
+++ b/java/tsfile/src/main/java/org/apache/tsfile/file/metadata/TableSchema.java
@@ -107,6 +107,22 @@ public class TableSchema {
this.updatable = false;
}
+ public TableSchema(
+ String tableName,
+ List<IMeasurementSchema> columnSchemas,
+ List<ColumnCategory> columnCategories,
+ Map<String, Integer> columnPosIndex) {
+ this.tableName = tableName.toLowerCase();
+ this.measurementSchemas = columnSchemas;
+ this.columnPosIndex = columnPosIndex;
+ if (measurementSchemas.size() != columnPosIndex.size()) {
+ throw new IllegalArgumentException(
+ "Each column name in the table should be unique(case insensitive).");
+ }
+ this.columnCategories = columnCategories;
+ this.updatable = false;
+ }
+
public TableSchema(
String tableName,
List<String> columnNameList,