exceptionfactory commented on code in PR #11766:
URL: https://github.com/apache/nifi/pull/11766#discussion_r4198097348
##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractExecuteSQL.java:
##########
@@ -220,6 +221,11 @@ public void migrateProperties(final PropertyConfiguration
config) {
config.renameProperty("sql-post-query", SQL_POST_QUERY.getName());
config.renameProperty("esql-output-batch-size",
OUTPUT_BATCH_SIZE.getName());
config.renameProperty("esql-fetch-size", FETCH_SIZE.getName());
+ final Optional<String> configuredFetchSize =
config.getRawPropertyValue(FETCH_SIZE.getName());
+ if (configuredFetchSize.isPresent() &&
"0".equals(configuredFetchSize.get())) {
+ config.setProperty(FETCH_SIZE.getName(), "1000");
Review Comment:
Recommend declaring `DEFAULT_FETCH_SIZE = "1000"` and reusing both here an
in the `defaultValue()` of the property
##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestExecuteSQL.java:
##########
@@ -638,8 +640,25 @@ void testMigrateProperties() {
Map.entry(JdbcProperties.OLD_DEFAULT_SCALE_PROPERTY_NAME,
DEFAULT_SCALE.getName())
);
- final PropertyMigrationResult propertyMigrationResult =
runner.migrateProperties();
- assertEquals(expectedRenamed,
propertyMigrationResult.getPropertiesRenamed());
+ assertEquals("1000", AbstractExecuteSQL.FETCH_SIZE.getDefaultValue());
Review Comment:
It would be helpful to declare `defaultFetchSize = "1000"` or similar and
reuse that value across the assertions in this method
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]