markap14 commented on a change in pull request #3223: NIFI-5903: Allow
RecordPath to be used in QueryRecord processor. Also…
URL: https://github.com/apache/nifi/pull/3223#discussion_r255555728
##########
File path:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryRecord.java
##########
@@ -556,6 +566,23 @@ public int getRecordsRead() {
}
}
+ private SchemaPlus createRootSchema(final CalciteConnection
calciteConnection) {
+ final SchemaPlus rootSchema = calciteConnection.getRootSchema();
+ // TODO: Document how to use RPATH functions in additionalDetails.html!
+ // TODO: Be sure to explain how/when to use each. For example, can
just use RPATH when SELECTing the value but if using in a LIKE expression,
+ // need a String so use RPATH_STRING
+ // TODO: Probably worth writing a blog post
+ rootSchema.add("RPATH",
ScalarFunctionImpl.create(ObjectRecordPath.class, "eval"));
+ rootSchema.add("RPATH_STRING",
ScalarFunctionImpl.create(StringRecordPath.class, "eval"));
Review comment:
I could argue it either way, to be honest. However, it's not clear to me
whether or not Calcite supports function overloading - or, if it does, how to
accomplish it. It's also uncommon that the user will need to use anything other
than the `RPATH` function but these are available just in case.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services