[fix](planner) table valued function could not used in subquery (#15496)
This commit is contained in:
@ -304,7 +304,6 @@ public class SelectStmt extends QueryStmt {
|
||||
inlineStmt.getTables(analyzer, expandView, tableMap, parentViewNameSet);
|
||||
} else if (tblRef instanceof TableValuedFunctionRef) {
|
||||
TableValuedFunctionRef tblFuncRef = (TableValuedFunctionRef) tblRef;
|
||||
tblFuncRef.analyze(analyzer);
|
||||
tableMap.put(tblFuncRef.getTableFunction().getTable().getId(),
|
||||
tblFuncRef.getTableFunction().getTable());
|
||||
} else {
|
||||
|
||||
@ -32,10 +32,12 @@ public class TableValuedFunctionRef extends TableRef {
|
||||
private String funcName;
|
||||
private Map<String, String> params;
|
||||
|
||||
public TableValuedFunctionRef(String funcName, String alias, Map<String, String> params) {
|
||||
public TableValuedFunctionRef(String funcName, String alias, Map<String, String> params) throws AnalysisException {
|
||||
super(new TableName(null, null, "_table_valued_function_" + funcName), alias);
|
||||
this.funcName = funcName;
|
||||
this.params = params;
|
||||
this.tableFunction = TableValuedFunctionIf.getTableFunction(funcName, params);
|
||||
this.table = tableFunction.getTable();
|
||||
if (hasExplicitAlias()) {
|
||||
return;
|
||||
}
|
||||
@ -70,10 +72,6 @@ public class TableValuedFunctionRef extends TableRef {
|
||||
if (isAnalyzed) {
|
||||
return;
|
||||
}
|
||||
// Table function could generate a table which will has columns
|
||||
// Maybe will call be during this process
|
||||
this.tableFunction = TableValuedFunctionIf.getTableFunction(funcName, params);
|
||||
this.table = tableFunction.getTable();
|
||||
desc = analyzer.registerTableRef(this);
|
||||
isAnalyzed = true; // true that we have assigned desc
|
||||
analyzeJoin(analyzer);
|
||||
|
||||
Reference in New Issue
Block a user