This is an automated email from the ASF dual-hosted git repository.

ibzib pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new b1fcfe9  [BEAM-10925] Add UdfProvider interface.
     new e4ee5f5  Merge pull request #13587 from ibzib/udf-provider
b1fcfe9 is described below

commit b1fcfe9f69ac59880586a909544c7619ffcb9e86
Author: Kyle Weaver <kcwea...@google.com>
AuthorDate: Mon Dec 21 11:27:29 2020 -0800

    [BEAM-10925] Add UdfProvider interface.
---
 .../beam/sdk/extensions/sql/udf/UdfProvider.java   | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git 
a/sdks/java/extensions/sql/udf/src/main/java/org/apache/beam/sdk/extensions/sql/udf/UdfProvider.java
 
b/sdks/java/extensions/sql/udf/src/main/java/org/apache/beam/sdk/extensions/sql/udf/UdfProvider.java
new file mode 100644
index 0000000..fe8b5b5
--- /dev/null
+++ 
b/sdks/java/extensions/sql/udf/src/main/java/org/apache/beam/sdk/extensions/sql/udf/UdfProvider.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.sdk.extensions.sql.udf;
+
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * Provider for user-defined functions written in Java. Implementations should 
be annotated with
+ * {@link com.google.auto.service.AutoService}.
+ */
+public interface UdfProvider {
+  /** Maps function names to scalar function implementations. */
+  default Map<String, ScalarFn> userDefinedScalarFunctions() {
+    return Collections.emptyMap();
+  }
+
+  /** Maps function names to aggregate function implementations. */
+  default Map<String, AggregateFn<?, ?, ?>> userDefinedAggregateFunctions() {
+    return Collections.emptyMap();
+  }
+}

Reply via email to