From 2b6d6c25d8a35625697d98b4827a6badfb8e2f69 Mon Sep 17 00:00:00 2001 From: Byunghwa Yun Date: Sun, 13 Nov 2016 12:21:14 +0900 Subject: [PATCH] NIFI-2866 The Initial Max Value of QueryDatabaseTable won't be case-sensitive Signed-off-by: Matt Burgess This closes #1212 --- .../apache/nifi/processors/standard/QueryDatabaseTable.java | 4 ++-- .../nifi/processors/standard/QueryDatabaseTableTest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryDatabaseTable.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryDatabaseTable.java index 278cc30f25..da3d496065 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryDatabaseTable.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryDatabaseTable.java @@ -200,8 +200,8 @@ public class QueryDatabaseTable extends AbstractDatabaseFetchProcessor { //If an initial max value for column(s) has been specified using properties, and this column is not in the state manager, sync them to the state property map for(final Map.Entry maxProp : maxValueProperties.entrySet()){ - if(!statePropertyMap.containsKey(maxProp.getKey())){ - statePropertyMap.put(maxProp.getKey(), maxProp.getValue()); + if (!statePropertyMap.containsKey(maxProp.getKey().toLowerCase())) { + statePropertyMap.put(maxProp.getKey().toLowerCase(), maxProp.getValue()); } } diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/QueryDatabaseTableTest.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/QueryDatabaseTableTest.java index f3904ef358..8a6d0b1c74 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/QueryDatabaseTableTest.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/QueryDatabaseTableTest.java @@ -635,7 +635,7 @@ public class QueryDatabaseTableTest { cal.setTimeInMillis(0); cal.add(Calendar.MINUTE, 5); - runner.setProperty("initial.maxvalue.created_on", dateFormat.format(cal.getTime().getTime())); + runner.setProperty("initial.maxvalue.CREATED_ON", dateFormat.format(cal.getTime().getTime())); // Initial run with no previous state. Should get only last 4 records runner.run(); runner.assertAllFlowFilesTransferred(QueryDatabaseTable.REL_SUCCESS, 1);