Github user pvillard31 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2212#discussion_r145050335
--- Diff:
nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/SelectHiveQL.java
---
@@ -243,95 +284,152 @@ private void onTrigger(final ProcessContext context,
final ProcessSession sessio
// If the query is not set, then an incoming flow file is
required, and expected to contain a valid SQL select query.
// If there is no incoming connection, onTrigger will not be
called as the processor will fail when scheduled.
final StringBuilder queryContents = new StringBuilder();
- session.read(fileToProcess, new InputStreamCallback() {
- @Override
- public void process(InputStream in) throws IOException {
- queryContents.append(IOUtils.toString(in));
- }
- });
+ session.read(fileToProcess, in ->
queryContents.append(IOUtils.toString(in, charset)));
selectQuery = queryContents.toString();
}
+ final Integer fetchSize =
context.getProperty(FETCH_SIZE).evaluateAttributeExpressions().asInteger();
--- End diff --
Any reason not to use the incoming flow file for evaluation? (not sure it'd
be a valid use case though)
---