mirror of https://github.com/apache/iotdb
Load: Added the missing logic for tsFile conversion disable's cherry-picking (#16024)
* Update TreeSchemaAutoCreatorAndVerifier.java * Update LoadTsFileTableSchemaCache.java
This commit is contained in:
parent
441f85183a
commit
5b3cd27d5e
|
@ -25,7 +25,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TDatabaseSchema;
|
|||
import org.apache.iotdb.db.conf.IoTDBConfig;
|
||||
import org.apache.iotdb.db.conf.IoTDBDescriptor;
|
||||
import org.apache.iotdb.db.exception.load.LoadAnalyzeException;
|
||||
import org.apache.iotdb.db.exception.load.LoadAnalyzeTypeMismatchException;
|
||||
import org.apache.iotdb.db.exception.load.LoadRuntimeOutOfMemoryException;
|
||||
import org.apache.iotdb.db.exception.sql.SemanticException;
|
||||
import org.apache.iotdb.db.queryengine.common.MPPQueryContext;
|
||||
|
@ -356,14 +355,14 @@ public class LoadTsFileTableSchemaCache {
|
|||
}
|
||||
} else if (fileColumn.getColumnCategory() == TsTableColumnCategory.FIELD) {
|
||||
ColumnSchema realColumn = fieldColumnNameToSchema.get(fileColumn.getName());
|
||||
if (realColumn == null || !fileColumn.getType().equals(realColumn.getType())) {
|
||||
throw new LoadAnalyzeTypeMismatchException(
|
||||
String.format(
|
||||
"Data type mismatch for column %s in table %s, type in TsFile: %s, type in IoTDB: %s",
|
||||
realColumn.getName(),
|
||||
realSchema.getTableName(),
|
||||
fileColumn.getType(),
|
||||
realColumn.getType()));
|
||||
if (LOGGER.isDebugEnabled()
|
||||
&& (realColumn == null || !fileColumn.getType().equals(realColumn.getType()))) {
|
||||
LOGGER.debug(
|
||||
"Data type mismatch for column {} in table {}, type in TsFile: {}, type in IoTDB: {}",
|
||||
realColumn.getName(),
|
||||
realSchema.getTableName(),
|
||||
fileColumn.getType(),
|
||||
realColumn.getType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -439,13 +439,12 @@ public class TreeSchemaAutoCreatorAndVerifier {
|
|||
// check device schema: is aligned or not
|
||||
final boolean isAlignedInTsFile = schemaCache.getDeviceIsAligned(device);
|
||||
final boolean isAlignedInIoTDB = iotdbDeviceSchemaInfo.isAligned();
|
||||
if (isAlignedInTsFile != isAlignedInIoTDB) {
|
||||
throw new LoadAnalyzeException(
|
||||
String.format(
|
||||
"Device %s in TsFile is %s, but in IoTDB is %s.",
|
||||
device,
|
||||
isAlignedInTsFile ? "aligned" : "not aligned",
|
||||
isAlignedInIoTDB ? "aligned" : "not aligned"));
|
||||
if (LOGGER.isDebugEnabled() && isAlignedInTsFile != isAlignedInIoTDB) {
|
||||
LOGGER.debug(
|
||||
"Device {} in TsFile is {}, but in IoTDB is {}.",
|
||||
device,
|
||||
isAlignedInTsFile ? "aligned" : "not aligned",
|
||||
isAlignedInIoTDB ? "aligned" : "not aligned");
|
||||
}
|
||||
|
||||
// check timeseries schema
|
||||
|
@ -463,15 +462,14 @@ public class TreeSchemaAutoCreatorAndVerifier {
|
|||
}
|
||||
|
||||
// check datatype
|
||||
if (!tsFileSchema.getType().equals(iotdbSchema.getType())) {
|
||||
throw new LoadAnalyzeTypeMismatchException(
|
||||
String.format(
|
||||
"Measurement %s%s%s datatype not match, TsFile: %s, IoTDB: %s",
|
||||
device,
|
||||
TsFileConstant.PATH_SEPARATOR,
|
||||
iotdbSchema.getMeasurementName(),
|
||||
tsFileSchema.getType(),
|
||||
iotdbSchema.getType()));
|
||||
if (LOGGER.isDebugEnabled() && !tsFileSchema.getType().equals(iotdbSchema.getType())) {
|
||||
LOGGER.debug(
|
||||
"Measurement {}{}{} datatype not match, TsFile: {}, IoTDB: {}",
|
||||
device,
|
||||
TsFileConstant.PATH_SEPARATOR,
|
||||
iotdbSchema.getMeasurementName(),
|
||||
tsFileSchema.getType(),
|
||||
iotdbSchema.getType());
|
||||
}
|
||||
|
||||
// check encoding
|
||||
|
|
Loading…
Reference in New Issue