diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONToSQL.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONToSQL.java index 638ec9dc5c..9705dc0954 100755 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONToSQL.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertJSONToSQL.java @@ -547,7 +547,7 @@ public class ConvertJSONToSQL extends AbstractProcessor { case Types.NUMERIC: if (fieldNode.isBoolean()) { // Convert boolean to number representation for databases those don't support boolean type. - fieldValue = fieldNode.asBoolean() ? "0" : "1"; + fieldValue = fieldNode.asBoolean() ? "1" : "0"; } break; diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestConvertJSONToSQL.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestConvertJSONToSQL.java index 8a03a81078..26f04a2601 100755 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestConvertJSONToSQL.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestConvertJSONToSQL.java @@ -205,9 +205,8 @@ public class TestConvertJSONToSQL { out.assertAttributeEquals("sql.args.1.value", "1"); out.assertAttributeEquals("sql.args.2.type", String.valueOf(java.sql.Types.VARCHAR)); out.assertAttributeEquals("sql.args.2.value", "Bool"); - // Boolean value 'true' is converted to '0' out.assertAttributeEquals("sql.args.3.type", String.valueOf(java.sql.Types.INTEGER)); - out.assertAttributeEquals("sql.args.3.value", "0"); + out.assertAttributeEquals("sql.args.3.value", "1"); out.assertContentEquals("INSERT INTO PERSONS (ID, NAME, CODE) VALUES (?, ?, ?)"); }