Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
03a5c3d
tmp save
jt2594838 Nov 26, 2025
f348433
Add SchemaEvolutionFIle
jt2594838 Nov 27, 2025
eb1df4a
EvolvedSchema may merge
jt2594838 Nov 27, 2025
f4d9110
add mergedSchema
jt2594838 Nov 27, 2025
06a848f
rewrite lastFlushTimeMap
jt2594838 Nov 27, 2025
4ced268
supplement DataRegionTest
jt2594838 Nov 27, 2025
f71b715
Add DataRegionTask
jt2594838 Dec 10, 2025
c0af94b
Add DataRegionTask
jt2594838 Dec 10, 2025
acd7623
add EvolceSchemaNode
jt2594838 Dec 10, 2025
a7dd102
Add execution of EvolveSchemaNode
jt2594838 Dec 10, 2025
5e680e0
Evolve schema in FileLoaderUtils
jt2594838 Dec 24, 2025
67bc845
add EvolvedSchema.toSchemaEvolutions
jt2594838 Dec 24, 2025
5f64c45
support delete with sevo
jt2594838 Dec 25, 2025
10a5553
support load with sevo
jt2594838 Dec 29, 2025
3d2c880
remove empty file sets in start up
jt2594838 Dec 30, 2025
12b959a
temp
jt2594838 Dec 31, 2025
c54b065
temp
jt2594838 Jan 4, 2026
12bcb3a
support ReadPointCompactionPerformer with sevo
jt2594838 Jan 7, 2026
d3d21df
bump tsfile version
jt2594838 Jan 12, 2026
498f392
support sevo in ReadChunkCompactionPerformer
jt2594838 Jan 13, 2026
ce18f8d
Support sevo in FastCompactionPerformer and cross compaction
jt2594838 Jan 13, 2026
448be89
Add EvolvedSchemaCache
jt2594838 Jan 13, 2026
5887fa7
Update EvolvedSchemaCache
jt2594838 Jan 13, 2026
3497b6e
Merge branch 'master' into force_ci/support_schema_evolution
jt2594838 Jan 13, 2026
3a059a5
fix compilation
jt2594838 Jan 13, 2026
1419259
suppor schema evolution in schema region
jt2594838 Jan 15, 2026
5fa3d20
add more tests
jt2594838 Jan 15, 2026
9c2898b
spotless
jt2594838 Jan 15, 2026
33dd195
fix that copy of EvolvedSchema is not deep enough
jt2594838 Jan 16, 2026
452ef81
spotless
jt2594838 Jan 16, 2026
2d0abd8
add more tests
jt2594838 Jan 16, 2026
7617259
add more tests
jt2594838 Jan 19, 2026
f22906e
Merge branch 'master' into force_ci/support_schema_evolution
jt2594838 Jan 20, 2026
cdd0b87
reduce lock contention
jt2594838 Jan 20, 2026
ff692ab
improve efficiency
jt2594838 Jan 21, 2026
0cd5e6c
Fix deviceId reuse when querying data region
jt2594838 Jan 21, 2026
31ae8bd
add more tetst
jt2594838 Jan 26, 2026
e46b91d
spotss
jt2594838 Jan 26, 2026
c52ae09
Merge branch 'master' into force_ci/support_schema_evolution
jt2594838 Jan 26, 2026
1faf2d1
remove unused dependenccy
jt2594838 Jan 26, 2026
01d39d5
remove improper input
jt2594838 Jan 26, 2026
cf00d07
Add licenses
jt2594838 Jan 26, 2026
7c80906
Fix auto-create table
jt2594838 Jan 27, 2026
59bd3c7
spotless
jt2594838 Jan 27, 2026
b99a087
Fix table device judgement
jt2594838 Jan 27, 2026
e7abe69
revert grafana test
jt2594838 Jan 27, 2026
7d89578
fix compaction test
jt2594838 Jan 27, 2026
5589a7e
update tsfile version
jt2594838 Jan 28, 2026
c25ab49
trigger ci
jt2594838 Jan 28, 2026
537c3b0
Revert "remove unused dependenccy"
jt2594838 Jan 28, 2026
8d42a92
add back checker
jt2594838 Jan 28, 2026
91e5ed5
Merge branch 'master' into force_ci/support_schema_evolution
jt2594838 Jan 28, 2026
d28d71c
Merge branch 'master' into force_ci/support_schema_evolution
jt2594838 Jan 29, 2026
aba6588
fix not overridden method
jt2594838 Jan 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ iotdb-core/tsfile/src/main/antlr4/org/apache/tsfile/parser/gen/
.mvn/.gradle-enterprise/
.mvn/.develocity/
.run/
*.sevo

# Relational Grammar ANTLR
iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/.antlr/
1 change: 0 additions & 1 deletion dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
"org.bouncycastle:bcprov-jdk18on",
"org.bouncycastle:bcutil-jdk18on",
"org.checkerframework:checker-qual",
"org.checkerframework:checker-qual",
"org.eclipse.collections:eclipse-collections",
"org.eclipse.collections:eclipse-collections-api",
"org.eclipse.jetty:jetty-http",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ protected void handleExceptions(Exception[] exceptions) throws SQLException {
break;
}
}

if (!exceptionInconsistent && exceptionMsg[0] != null) {
throw new SQLException(exceptionMsg[0]);
}
for (int i = 0; i < businessExceptions.length; i++) {
if (businessExceptions[i] != null) {
// As each exception has its own stacktrace, in order to display them clearly, we can only
Expand All @@ -134,9 +138,6 @@ protected void handleExceptions(Exception[] exceptions) throws SQLException {
"Exception happens during request to {}", getEndpoints().get(i), businessExceptions[i]);
}
}
if (!exceptionInconsistent && exceptionMsg[0] != null) {
throw new SQLException(exceptionMsg[0]);
}
if (exceptionInconsistent) {
throw new InconsistentDataException(Arrays.asList(exceptionMsg), getEndpoints());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

package org.apache.iotdb.relational.it.db.it;

import org.apache.iotdb.db.storageengine.dataregion.tsfile.evolution.ColumnRename;
import org.apache.iotdb.db.storageengine.dataregion.tsfile.evolution.SchemaEvolution;
import org.apache.iotdb.db.storageengine.dataregion.tsfile.evolution.SchemaEvolutionFile;
import org.apache.iotdb.db.storageengine.dataregion.tsfile.evolution.TableRename;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.it.utils.TsFileTableGenerator;
Expand All @@ -45,12 +49,18 @@
import java.nio.file.Files;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail;

@RunWith(IoTDBTestRunner.class)
@Category({TableLocalStandaloneIT.class, TableClusterIT.class})
public class IoTDBLoadTsFileIT {
Expand Down Expand Up @@ -255,7 +265,91 @@ public void testLoadWithTableMod() throws Exception {

try (final ResultSet resultSet = statement.executeQuery("show tables")) {
Assert.assertTrue(resultSet.next());
Assert.assertFalse(resultSet.next());
assertFalse(resultSet.next());
}
}
}

@Test
public void testLoadWithSevoFile() throws Exception {
final int lineCount = 10000;

List<Pair<MeasurementSchema, MeasurementSchema>> measurementSchemas =
generateMeasurementSchemas();
List<ColumnCategory> columnCategories =
generateTabletColumnCategory(0, measurementSchemas.size());

final File file = new File(tmpDir, "1-0-0-0.tsfile");

List<MeasurementSchema> schemaList1 =
measurementSchemas.stream().map(pair -> pair.left).collect(Collectors.toList());

try (final TsFileTableGenerator generator = new TsFileTableGenerator(file)) {
generator.registerTable(SchemaConfig.TABLE_0, new ArrayList<>(schemaList1), columnCategories);
generator.generateData(SchemaConfig.TABLE_0, lineCount, PARTITION_INTERVAL / 10_000);
}

// rename table0 to table1
File sevoFile = new File(tmpDir, "0.sevo");
SchemaEvolutionFile schemaEvolutionFile = new SchemaEvolutionFile(sevoFile.getAbsolutePath());
SchemaEvolution schemaEvolution = new TableRename(SchemaConfig.TABLE_0, SchemaConfig.TABLE_1);
schemaEvolutionFile.append(Collections.singletonList(schemaEvolution));
// rename INT322INT32 to INT322INT32_NEW
schemaEvolution = new ColumnRename(SchemaConfig.TABLE_1, "INT322INT32", "INT322INT32_NEW");
schemaEvolutionFile.append(Collections.singletonList(schemaEvolution));

try (final Connection connection =
EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
final Statement statement = connection.createStatement()) {
statement.execute(String.format("create database if not exists %s", SchemaConfig.DATABASE_0));
statement.execute(String.format("use %s", SchemaConfig.DATABASE_0));
statement.execute(
String.format(
"load '%s' with ('database'='%s', 'sevo-file-path'='%s')",
file.getAbsolutePath(), SchemaConfig.DATABASE_0, schemaEvolutionFile.getFilePath()));

// cannot query using table0
try (final ResultSet resultSet =
statement.executeQuery(String.format("select count(*) from %s", SchemaConfig.TABLE_0))) {
fail();
} catch (SQLException e) {
assertEquals("550: Table 'root.test' does not exist.", e.getMessage());
}

// can query with table1
try (final ResultSet resultSet =
statement.executeQuery(String.format("select count(*) from %s", SchemaConfig.TABLE_1))) {
if (resultSet.next()) {
Assert.assertEquals(lineCount, resultSet.getLong(1));
} else {
Assert.fail("This ResultSet is empty.");
}
}

// cannot query using INT322INT32
try (final ResultSet resultSet =
statement.executeQuery(
String.format("select count(%s) from %s", "INT322INT32", SchemaConfig.TABLE_1))) {
fail();
} catch (SQLException e) {
assertEquals("616: Column 'int322int32' cannot be resolved", e.getMessage());
}

// can query with INT322INT32_NEW
try (final ResultSet resultSet =
statement.executeQuery(
String.format("select count(%s) from %s", "INT322INT32_NEW", SchemaConfig.TABLE_1))) {
if (resultSet.next()) {
Assert.assertEquals(lineCount, resultSet.getLong(1));
} else {
Assert.fail("This ResultSet is empty.");
}
}

try (final ResultSet resultSet = statement.executeQuery("show tables")) {
Assert.assertTrue(resultSet.next());
assertEquals(SchemaConfig.TABLE_1, resultSet.getString(1));
assertFalse(resultSet.next());
}
}
}
Expand Down
Loading
Loading