sjwiesman commented on a change in pull request #10110: [FLINK-14301][doc] add 
documentation for functions categories and new function resolution orders
URL: https://github.com/apache/flink/pull/10110#discussion_r343929521
 
 

 ##########
 File path: docs/dev/table/functions/index.md
 ##########
 @@ -0,0 +1,96 @@
+---
+title: "Functions"
+nav-id: table_functions
+nav-parent_id: tableapi
+nav-pos: 116
+is_beta: true
+nav-show_overview: true
+---
+<!--
+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.
+-->
+
+Flink Table API & SQL empowers users to do data transformations with functions.
+
+Types of Functions
+------------------
+
+There are two dimensions to classify functions in Flink.
+
+One dimension is system (or built-in) functions v.s. catalog functions. System 
functions have no namespace and can be
+referenced with just their names. Catalog functions belong to a catalog and 
database therefore they have catalog and database
+namespaces, they can be referenced by either fully/partially qualified name 
(`catalog.db.func` or `db.func`) or just the
+function name.
+
+The other dimension is temporary functions v.s. persistent functions. 
Temporary functions are volatile and only live up to
+ lifespan of a session, they are always created by users. Persistent functions 
live across lifespan of sessions, they are either
+ provided by the system or persisted in catalogs.
+ 
+The two dimensions give Flink users 4 categories of functions:
+
+1. Temporary system functions
+2. System functions
+3. Temporary catalog functions
+4. Catalog functions
+
+Referencing Functions
+---------------------
+
+There are two ways users can reference a function in Flink - referencing 
function precisely or ambiguously.
+
+## Precise Function Reference
+
+Precise function reference empowers users to use catalog functions 
specifically, and across catalog and across database, 
+e.g. `select mycatalog.mydb.myfunc(x) from mytable` and `select mydb.myfunc(x) 
from mytable`.
+
+This is only supported starting from Flink 1.10.
+
+## Ambiguous Function Reference
+
+In ambiguous function reference, users just specify the function's name in SQL 
query, e.g. `select myfunc(x) from mytable`.
+
+This is the only supported option before Flink 1.10.
+
+
+Function Resolution Order
+-------------------------
+
+The resolution order only matters when there are functions of different types 
but the same name, 
+e.g. when there’re three functions all named “myfunc” but are of temporary 
catalog, catalog, and system function respectively. 
+If there’s no function name collision, functions will just be resolved to the 
sole one.
+
+## Precise Function Reference
+
+Because system functions don’t have namespaces, a precise function reference 
in Flink must be pointing to either a temporary catalog 
+function or a catalog function.
+
+The resolution order is:
+
+1. Temporary catalog function
+2. Catalog function
+
+## Ambiguous Function Reference
+
+In Flink 1.10, we also redefined its function resolution order to be:
+
+The new order is:
 
 Review comment:
   I don't understand this change well enough to be able to respond to that, 
however, I generally feel these kinds of changes are what release notes are 
for. I'd like to hear @dawidwys or @fhueske opinion and if they say it stays 
then +1 from me. 

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to