Source:
<code>public static Map<LoaderProperty, Object> getLoaderProps( TSnowflakeOutputProperties outputProperties, Schema mainSchema) { SnowflakeConnectionProperties connectionProperties = outputProperties.getConnectionProperties(); Map<LoaderProperty, Object> prop = new HashMap<>(); boolean isUpperCase = outputProperties.convertColumnsAndTableToUppercase.getValue(); String tableName = isUpperCase ? outputProperties.getTableName().toUpperCase() : outputProperties.getTableName(); prop.put(LoaderProperty.tableName, tableName); prop.put(LoaderProperty.schemaName, connectionProperties.schemaName.getStringValue()); prop.put(LoaderProperty.databaseName, connectionProperties.db.getStringValue()); switch (outputProperties.outputAction.getValue()) { case INSERT: prop.put(LoaderProperty.operation, Operation.INSERT); break; case UPDATE: prop.put(LoaderProperty.operation, Operation.MODIFY); break; case UPSERT: prop.put(LoaderProperty.operation, Operation.UPSERT); break; case DELETE: prop.put(LoaderProperty.operation, Operation.DELETE); break; } List<Field> columns = mainSchema.getFields(); List<String> keyStr = new ArrayList<>(); List<String> columnsStr = new ArrayList<>(); for (Field f : columns) { String dbColumnName = f.getProp(SchemaConstants.TALEND_COLUMN_DB_COLUMN_NAME); String fName = isUpperCase ? dbColumnName.toUpperCase() : dbColumnName; columnsStr.add(fName); if (null != f.getProp(SchemaConstants.TALEND_COLUMN_IS_KEY)) { keyStr.add(fName); } } prop.put(LoaderProperty.columns, columnsStr); if (outputProperties.outputAction.getValue() == UPSERT) { keyStr.clear(); keyStr.add(outputProperties.upsertKeyColumn.getValue()); } if (keyStr.size() > 0) { prop.put(LoaderProperty.keys, keyStr); } prop.put(LoaderProperty.remoteStage, "~"); TableActionEnum selectedTableAction = outputProperties.tableAction.getValue(); <START> if (selectedTableAction == TableActionEnum.TRUNCATE) { <END> prop.put(LoaderProperty.truncateTable, "true"); } return prop; }</code><technical_language>(eq)</technical_language>

Target:
public static Map<LoaderProperty, Object> getLoaderProps( TSnowflakeOutputProperties outputProperties, Schema mainSchema) { SnowflakeConnectionProperties connectionProperties = outputProperties.getConnectionProperties(); Map<LoaderProperty, Object> prop = new HashMap<>(); boolean isUpperCase = outputProperties.convertColumnsAndTableToUppercase.getValue(); String tableName = isUpperCase ? outputProperties.getTableName().toUpperCase() : outputProperties.getTableName(); prop.put(LoaderProperty.tableName, tableName); prop.put(LoaderProperty.schemaName, connectionProperties.schemaName.getStringValue()); prop.put(LoaderProperty.databaseName, connectionProperties.db.getStringValue()); switch (outputProperties.outputAction.getValue()) { case INSERT: prop.put(LoaderProperty.operation, Operation.INSERT); break; case UPDATE: prop.put(LoaderProperty.operation, Operation.MODIFY); break; case UPSERT: prop.put(LoaderProperty.operation, Operation.UPSERT); break; case DELETE: prop.put(LoaderProperty.operation, Operation.DELETE); break; } List<Field> columns = mainSchema.getFields(); List<String> keyStr = new ArrayList<>(); List<String> columnsStr = new ArrayList<>(); for (Field f : columns) { String dbColumnName = f.getProp(SchemaConstants.TALEND_COLUMN_DB_COLUMN_NAME); String fName = isUpperCase ? dbColumnName.toUpperCase() : dbColumnName; columnsStr.add(fName); if (null != f.getProp(SchemaConstants.TALEND_COLUMN_IS_KEY)) { keyStr.add(fName); } } prop.put(LoaderProperty.columns, columnsStr); if (UPSERT.equals(outputProperties.outputAction.getValue())) { keyStr.clear(); keyStr.add(outputProperties.upsertKeyColumn.getValue()); } if (keyStr.size() > 0) { prop.put(LoaderProperty.keys, keyStr); } prop.put(LoaderProperty.remoteStage, "~"); TableActionEnum selectedTableAction = outputProperties.tableAction.getValue(); if (TableActionEnum.TRUNCATE.equals(selectedTableAction)) { prop.put(LoaderProperty.truncateTable, "true"); } return prop; }