Github user pvillard31 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2138#discussion_r213333538
--- Diff:
nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/main/java/org/apache/nifi/processors/hive/AbstractHive3QLProcessor.java
---
@@ -345,4 +348,22 @@ private void findTableNames(final Object obj, final
Set<TableName> tableNames) {
}
return attributes;
}
+
+ /**
+ * Method to set the configured timeout on the statement to be executed
+ * @param stmt statement to be executed
+ * @param context process context to retrieve the configured value
+ * @param flowFile flow file to evaluate expression language
+ * @throws ProcessException exception in case configured value cannot
be converted to an integer
+ */
+ protected void setTimeout(Statement stmt, ProcessContext context,
FlowFile flowFile) throws ProcessException {
--- End diff --
The try/catch is still valid in case of error during the EL evaluation
(when EL is used to set the timeout value). I could remove the setTimeout in
the abstract class and just use setQueryTimeout directly in the Select/Put
classes but I'd still have to define how I deal with SQLException and
NumberFormatException. Honestly I think it's better to keep it as-is to have
some sort of consistency between the two bundles.
---