Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ public PipeConvertedInsertRowStatement(final InsertRowStatement insertRowStateme

@Override
protected boolean checkAndCastDataType(int columnIndex, TSDataType dataType) {
PipeLogger.log(
LOGGER::info,
"Pipe: Inserting row to %s.%s. Casting type from %s to %s.",
devicePath,
measurements[columnIndex],
dataTypes[columnIndex],
dataType);
if (LOGGER.isInfoEnabled()) {
PipeLogger.log(
LOGGER::info,
"Pipe: Inserting row. Casting type from %s to %s.",
dataTypes[columnIndex],
dataType);
}
values[columnIndex] =
ValueConverter.convert(dataTypes[columnIndex], dataType, values[columnIndex]);
dataTypes[columnIndex] = dataType;
Expand Down Expand Up @@ -122,15 +122,12 @@ public void transferType(ZoneId zoneId) throws QueryProcessException {
try {
values[i] = ValueConverter.parse(values[i].toString(), dataTypes[i]);
} catch (Exception e) {
PipeLogger.log(
LOGGER::warn,
"data type of %s.%s is not consistent, "
+ "registered type %s, inserting timestamp %s, value %s",
devicePath,
measurements[i],
dataTypes[i],
time,
values[i]);
if (LOGGER.isWarnEnabled()) {
PipeLogger.log(
LOGGER::warn,
"Pipe: Failed to parse row value during data type conversion. Registered type %s.",
dataTypes[i]);
}
if (!IoTDBDescriptor.getInstance().getConfig().isEnablePartialInsert()) {
throw e;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.apache.iotdb.db.pipe.receiver.transform.statement;

import org.apache.iotdb.commons.pipe.resource.log.PipeLogger;
import org.apache.iotdb.db.pipe.receiver.transform.converter.ArrayConverter;
import org.apache.iotdb.db.queryengine.plan.statement.crud.InsertTabletStatement;

Expand Down Expand Up @@ -89,12 +90,13 @@ public PipeConvertedInsertTabletStatement(final InsertTabletStatement insertTabl

@Override
protected boolean checkAndCastDataType(int columnIndex, TSDataType dataType) {
LOGGER.info(
"Pipe: Inserting tablet to {}.{}. Casting type from {} to {}.",
devicePath,
measurements[columnIndex],
dataTypes[columnIndex],
dataType);
if (LOGGER.isInfoEnabled()) {
PipeLogger.log(
LOGGER::info,
"Pipe: Inserting tablet. Casting type from %s to %s.",
dataTypes[columnIndex],
dataType);
}
columns[columnIndex] =
ArrayConverter.convert(dataTypes[columnIndex], dataType, columns[columnIndex]);
dataTypes[columnIndex] = dataType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.commons.pipe.config.PipeConfig;
import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBPipePattern;
import org.apache.iotdb.commons.pipe.resource.log.PipeLogger;
import org.apache.iotdb.db.pipe.event.common.tsfile.container.scan.TsFileInsertionScanDataContainer;
import org.apache.iotdb.db.pipe.receiver.protocol.thrift.IoTDBDataNodeReceiver;
import org.apache.iotdb.db.pipe.receiver.transform.statement.PipeConvertedInsertRowStatement;
Expand Down Expand Up @@ -73,7 +74,12 @@ private Optional<TSStatus> tryExecute(final Statement statement) {
try {
return Optional.of(statementExecutor.execute(statement));
} catch (final Exception e) {
LOGGER.warn("Failed to execute statement after data type conversion.", e);
if (LOGGER.isWarnEnabled()) {
PipeLogger.log(
LOGGER::warn,
"Pipe: Failed to execute statement after data type conversion. Exception type: %s.",
e.getClass().getName());
}
return Optional.empty();
}
}
Expand Down
Loading