Skip to content

Commit 5b3cd27

Browse files
authored
Load: Added the missing logic for tsFile conversion disable's cherry-picking (apache#16024)
* Update TreeSchemaAutoCreatorAndVerifier.java * Update LoadTsFileTableSchemaCache.java
1 parent 441f851 commit 5b3cd27

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileTableSchemaCache.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.iotdb.db.conf.IoTDBConfig;
2626
import org.apache.iotdb.db.conf.IoTDBDescriptor;
2727
import org.apache.iotdb.db.exception.load.LoadAnalyzeException;
28-
import org.apache.iotdb.db.exception.load.LoadAnalyzeTypeMismatchException;
2928
import org.apache.iotdb.db.exception.load.LoadRuntimeOutOfMemoryException;
3029
import org.apache.iotdb.db.exception.sql.SemanticException;
3130
import org.apache.iotdb.db.queryengine.common.MPPQueryContext;
@@ -356,14 +355,14 @@ private void verifyTableDataTypeAndGenerateIdColumnMapper(
356355
}
357356
} else if (fileColumn.getColumnCategory() == TsTableColumnCategory.FIELD) {
358357
ColumnSchema realColumn = fieldColumnNameToSchema.get(fileColumn.getName());
359-
if (realColumn == null || !fileColumn.getType().equals(realColumn.getType())) {
360-
throw new LoadAnalyzeTypeMismatchException(
361-
String.format(
362-
"Data type mismatch for column %s in table %s, type in TsFile: %s, type in IoTDB: %s",
363-
realColumn.getName(),
364-
realSchema.getTableName(),
365-
fileColumn.getType(),
366-
realColumn.getType()));
358+
if (LOGGER.isDebugEnabled()
359+
&& (realColumn == null || !fileColumn.getType().equals(realColumn.getType()))) {
360+
LOGGER.debug(
361+
"Data type mismatch for column {} in table {}, type in TsFile: {}, type in IoTDB: {}",
362+
realColumn.getName(),
363+
realSchema.getTableName(),
364+
fileColumn.getType(),
365+
realColumn.getType());
367366
}
368367
}
369368
}

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/TreeSchemaAutoCreatorAndVerifier.java

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -439,13 +439,12 @@ private void verifySchema(ISchemaTree schemaTree)
439439
// check device schema: is aligned or not
440440
final boolean isAlignedInTsFile = schemaCache.getDeviceIsAligned(device);
441441
final boolean isAlignedInIoTDB = iotdbDeviceSchemaInfo.isAligned();
442-
if (isAlignedInTsFile != isAlignedInIoTDB) {
443-
throw new LoadAnalyzeException(
444-
String.format(
445-
"Device %s in TsFile is %s, but in IoTDB is %s.",
446-
device,
447-
isAlignedInTsFile ? "aligned" : "not aligned",
448-
isAlignedInIoTDB ? "aligned" : "not aligned"));
442+
if (LOGGER.isDebugEnabled() && isAlignedInTsFile != isAlignedInIoTDB) {
443+
LOGGER.debug(
444+
"Device {} in TsFile is {}, but in IoTDB is {}.",
445+
device,
446+
isAlignedInTsFile ? "aligned" : "not aligned",
447+
isAlignedInIoTDB ? "aligned" : "not aligned");
449448
}
450449

451450
// check timeseries schema
@@ -463,15 +462,14 @@ private void verifySchema(ISchemaTree schemaTree)
463462
}
464463

465464
// check datatype
466-
if (!tsFileSchema.getType().equals(iotdbSchema.getType())) {
467-
throw new LoadAnalyzeTypeMismatchException(
468-
String.format(
469-
"Measurement %s%s%s datatype not match, TsFile: %s, IoTDB: %s",
470-
device,
471-
TsFileConstant.PATH_SEPARATOR,
472-
iotdbSchema.getMeasurementName(),
473-
tsFileSchema.getType(),
474-
iotdbSchema.getType()));
465+
if (LOGGER.isDebugEnabled() && !tsFileSchema.getType().equals(iotdbSchema.getType())) {
466+
LOGGER.debug(
467+
"Measurement {}{}{} datatype not match, TsFile: {}, IoTDB: {}",
468+
device,
469+
TsFileConstant.PATH_SEPARATOR,
470+
iotdbSchema.getMeasurementName(),
471+
tsFileSchema.getType(),
472+
iotdbSchema.getType());
475473
}
476474

477475
// check encoding

0 commit comments

Comments
 (0)