ibzib commented on a change in pull request #14263:
URL: https://github.com/apache/beam/pull/14263#discussion_r604343897
##########
File path:
sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/BeamZetaSqlCatalog.java
##########
@@ -276,6 +285,49 @@ private void addWindowTvfs() {
null));
}
+ private void addUdfsFromSchema() {
+ for (String functionName : calciteSchema.getFunctionNames()) {
+
Collection<org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.schema.Function>
+ functions = calciteSchema.getFunctions(functionName);
+ if (functions.size() != 1) {
+ throw new IllegalArgumentException(
+ String.format(
+ "Expected exactly 1 definition for function '%s', but found
%d.",
+ functionName, functions.size()));
+ }
+ for
(org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.schema.Function
function :
+ functions) {
+ if (function instanceof ScalarFunctionImpl) {
Review comment:
There are no other possible cases I'm aware of. I'll add that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]