You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSQL.java
+52-7Lines changed: 52 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,9 @@
72
72
importjava.text.ParseException;
73
73
importjava.text.SimpleDateFormat;
74
74
importjava.time.Instant;
75
+
importjava.time.LocalDate;
76
+
importjava.time.LocalTime;
77
+
importjava.time.ZoneId;
75
78
importjava.time.format.DateTimeFormatter;
76
79
importjava.time.temporal.TemporalAccessor;
77
80
importjava.util.ArrayList;
@@ -110,11 +113,13 @@
110
113
+ "sql.args.1.value, sql.args.2.value, sql.args.3.value, and so on. The type of the sql.args.1.value Parameter is specified by the sql.args.1.type attribute."),
111
114
@ReadsAttribute(attribute = "sql.args.N.format", description = "This attribute is always optional, but default options may not always work for your data. "
112
115
+ "Incoming FlowFiles are expected to be parametrized SQL statements. In some cases "
113
-
+ "a format option needs to be specified, currently this is only applicable for binary data types and timestamps. For binary data types "
114
-
+ "available options are 'ascii', 'base64' and 'hex'. In 'ascii' format each string character in your attribute value represents a single byte, this is the default format "
115
-
+ "and the format provided by Avro Processors. In 'base64' format your string is a Base64 encoded string. In 'hex' format the string is hex encoded with all "
116
-
+ "letters in upper case and no '0x' at the beginning. For timestamps, the format can be specified according to java.time.format.DateTimeFormatter."
117
-
+ "Customer and named patterns are accepted i.e. ('yyyy-MM-dd','ISO_OFFSET_DATE_TIME')")
116
+
+ "a format option needs to be specified, currently this is only applicable for binary data types, dates, times and timestamps. Binary Data Types (defaults to 'ascii') - "
117
+
+ "ascii: each string character in your attribute value represents a single byte. This is the format provided by Avro Processors. "
118
+
+ "base64: the string is a Base64 encoded string that can be decoded to bytes. "
119
+
+ "hex: the string is hex encoded with all letters in upper case and no '0x' at the beginning. "
120
+
+ "Dates/Times/Timestamps - "
121
+
+ "Date, Time and Timestamp formats all support both custom formats or named format ('yyyy-MM-dd','ISO_OFFSET_DATE_TIME') "
122
+
+ "as specified according to java.time.format.DateTimeFormatter.")
118
123
})
119
124
@WritesAttributes({
120
125
@WritesAttribute(attribute = "sql.generated.key", description = "If the database generated a key for an INSERT statement and the Obtain Generated Keys property is set to true, "
@@ -828,10 +833,50 @@ private void setParameter(final PreparedStatement stmt, final String attrName, f
Copy file name to clipboardExpand all lines: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSQL.java
+156Lines changed: 156 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -451,6 +451,77 @@ public void testUsingTimestampValuesWithFormatAttribute() throws InitializationE
0 commit comments