yiguolei commented on a change in pull request #7940:
URL: https://github.com/apache/incubator-doris/pull/7940#discussion_r800350506



##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/tablefunction/TableFunction.java
##########
@@ -0,0 +1,50 @@
+// 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.doris.tablefunction;
+
+import org.apache.doris.analysis.TupleDescriptor;
+import org.apache.doris.catalog.Column;
+import org.apache.doris.catalog.Table;
+import org.apache.doris.catalog.Table.TableType;
+import org.apache.doris.common.UserException;
+import org.apache.doris.planner.PlanNodeId;
+import org.apache.doris.planner.ScanNode;
+
+import java.util.List;
+
+public abstract class TableFunction {

Review comment:
       No, the table function really generate a temporary table during the 
query. It has scan operations and also has table schemas.
   Actually there are 2 kinds of table 
functions(https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-tvf.html.):
   1. TVF that can be specified in a FROM clause, e.g. range;
   2. TVF that can be specified in SELECT/LATERAL VIEW clauses, e.g. explode.
   Currently Clickhouse only support from clause table function 
https://clickhouse.com/docs/en/sql-reference/table-functions. 
   
   >>>For a "table function", it should support common expr as its parameter, 
such as referring a column from a table, or an Expression.
   
   This is not a problem, we could treat the string literal as a common expr 
and extend the parameter type in the future. But I think StringLiteral as 
parameter will meet many cases  because the actual table function could parse 
the string parameter as real db name or column names. 
   For example in clickhouse, 
https://clickhouse.com/docs/en/sql-reference/table-functions/merge/ the merge 
table function use dbname and table name as string parameters and the file 
table function also use column type as tring parameters 
https://clickhouse.com/docs/en/sql-reference/table-functions/file/.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to