github.com/matrixorigin/matrixone@v0.7.0/pkg/sql/plan/generate_series.go (about) 1 // Copyright 2022 Matrix Origin 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package plan 16 17 import ( 18 "github.com/matrixorigin/matrixone/pkg/container/types" 19 "github.com/matrixorigin/matrixone/pkg/pb/plan" 20 "github.com/matrixorigin/matrixone/pkg/sql/parsers/tree" 21 ) 22 23 func (builder *QueryBuilder) buildGenerateSeries(tbl *tree.TableFunction, ctx *BindContext, exprs []*plan.Expr, childId int32) int32 { 24 node := &plan.Node{ 25 NodeType: plan.Node_FUNCTION_SCAN, 26 Stats: &plan.Stats{}, 27 TableDef: &plan.TableDef{ 28 TableType: "func_table", //test if ok 29 //Name: tbl.String(), 30 TblFunc: &plan.TableFunction{ 31 Name: "generate_series", 32 }, 33 Cols: []*plan.ColDef{{ 34 Name: "result", 35 Typ: &plan.Type{ 36 Id: int32(types.T_varchar), 37 Width: types.MaxVarcharLen, 38 }, 39 }, 40 }, 41 }, 42 BindingTags: []int32{builder.genNewTag()}, 43 Children: []int32{childId}, 44 TblFuncExprList: exprs, 45 } 46 return builder.appendNode(node, ctx) 47 }