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

pabloem pushed a commit to branch release-2.27.0
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/release-2.27.0 by this push:
     new e84f8d5  [BEAM-10925] Add UdfProvider interface.
     new 712a5e4  Merge pull request #13590 from [BEAM-10925] [cherry-pick] Add 
UdfProvider interface.
e84f8d5 is described below

commit e84f8d558fab776930fa663f48af62cf1674124c
Author: Kyle Weaver <[email protected]>
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