ldd200888 commented on a change in pull request #5024:
URL: https://github.com/apache/nifi/pull/5024#discussion_r622002898
##########
File path:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDatabaseRecord.java
##########
@@ -691,15 +691,27 @@ private void executeDML(final ProcessContext context,
final ProcessSession sessi
final Object[] values = currentRecord.getValues();
final List<DataType> dataTypes =
currentRecord.getSchema().getDataTypes();
- List<ColumnDescription> columns =
tableSchema.getColumnsAsList();
for (int i = 0; i < fieldIndexes.size(); i++) {
final int currentFieldIndex = fieldIndexes.get(i);
Object currentValue = values[currentFieldIndex];
final DataType dataType =
dataTypes.get(currentFieldIndex);
final int fieldSqlType =
DataTypeUtils.getSQLTypeValue(dataType);
- final ColumnDescription column =
columns.get(currentFieldIndex);
- int sqlType = column.dataType;
+ final String fieldName =
currentRecord.getSchema().getField(currentFieldIndex).getFieldName();
+ String columnName =
normalizeColumnName(currentRecord.getSchema().getField(currentFieldIndex).getFieldName(),
settings.translateFieldNames);
Review comment:
call normalizeColumnName method too many times, maybe store the
columnName in a list is better.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]