github.com/dolthub/go-mysql-server@v0.18.0/sql/rowexec/node_builder.gen.go (about)

     1  // Copyright 2023 Dolthub, Inc.
     2  //
     3  // GENERATED
     4  //
     5  // Licensed under the Apache License, Version 2.0 (the "License");
     6  // you may not use this file except in compliance with the License.
     7  // You may obtain a copy of the License at
     8  //
     9  //     http://www.apache.org/licenses/LICENSE-2.0
    10  //
    11  // Unless required by applicable law or agreed to in writing, software
    12  // distributed under the License is distributed on an "AS IS" BASIS,
    13  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  // See the License for the specific language governing permissions and
    15  // limitations under the License.
    16  
    17  package rowexec
    18  
    19  import (
    20  	"fmt"
    21  
    22  	"github.com/dolthub/go-mysql-server/sql"
    23  	"github.com/dolthub/go-mysql-server/sql/plan"
    24  )
    25  
    26  func (b *BaseBuilder) buildNodeExec(ctx *sql.Context, n sql.Node, row sql.Row) (sql.RowIter, error) {
    27  	iter, err := b.buildNodeExecNoAnalyze(ctx, n, row)
    28  	if err != nil {
    29  		return nil, err
    30  	}
    31  	if withDescribeStats, ok := n.(sql.WithDescribeStats); ok {
    32  		iter = sql.NewCountingRowIter(iter, withDescribeStats)
    33  	}
    34  	return iter, nil
    35  }
    36  
    37  func (b *BaseBuilder) buildNodeExecNoAnalyze(ctx *sql.Context, n sql.Node, row sql.Row) (sql.RowIter, error) {
    38  	switch n := n.(type) {
    39  	case *plan.CreateForeignKey:
    40  		return b.buildCreateForeignKey(ctx, n, row)
    41  	case *plan.AlterTableCollation:
    42  		return b.buildAlterTableCollation(ctx, n, row)
    43  	case *plan.CreateRole:
    44  		return b.buildCreateRole(ctx, n, row)
    45  	case *plan.Loop:
    46  		return b.buildLoop(ctx, n, row)
    47  	case *plan.TransactionCommittingNode:
    48  		return b.buildTransactionCommittingNode(ctx, n, row)
    49  	case *plan.DropColumn:
    50  		return b.buildDropColumn(ctx, n, row)
    51  	case *plan.AnalyzeTable:
    52  		return b.buildAnalyzeTable(ctx, n, row)
    53  	case *plan.UpdateHistogram:
    54  		return b.buildUpdateHistogram(ctx, n, row)
    55  	case *plan.DropHistogram:
    56  		return b.buildDropHistogram(ctx, n, row)
    57  	case *plan.QueryProcess:
    58  		return b.buildQueryProcess(ctx, n, row)
    59  	case *plan.ShowReplicaStatus:
    60  		return b.buildShowReplicaStatus(ctx, n, row)
    61  	case *plan.UpdateSource:
    62  		return b.buildUpdateSource(ctx, n, row)
    63  	case plan.ElseCaseError:
    64  		return b.buildElseCaseError(ctx, n, row)
    65  	case *plan.PrepareQuery:
    66  		return b.buildPrepareQuery(ctx, n, row)
    67  	case *plan.ResolvedTable:
    68  		return b.buildResolvedTable(ctx, n, row)
    69  	case *plan.TableCountLookup:
    70  		return b.buildTableCount(ctx, n, row)
    71  	case *plan.ShowCreateTable:
    72  		return b.buildShowCreateTable(ctx, n, row)
    73  	case *plan.ShowIndexes:
    74  		return b.buildShowIndexes(ctx, n, row)
    75  	case *plan.PrependNode:
    76  		return b.buildPrependNode(ctx, n, row)
    77  	case *plan.UnresolvedTable:
    78  		return b.buildUnresolvedTable(ctx, n, row)
    79  	case *plan.Use:
    80  		return b.buildUse(ctx, n, row)
    81  	case *plan.CreateTable:
    82  		return b.buildCreateTable(ctx, n, row)
    83  	case *plan.CreateProcedure:
    84  		return b.buildCreateProcedure(ctx, n, row)
    85  	case *plan.CreateTrigger:
    86  		return b.buildCreateTrigger(ctx, n, row)
    87  	case *plan.IfConditional:
    88  		return b.buildIfConditional(ctx, n, row)
    89  	case *plan.ShowGrants:
    90  		return b.buildShowGrants(ctx, n, row)
    91  	case *plan.ShowDatabases:
    92  		return b.buildShowDatabases(ctx, n, row)
    93  	case *plan.UpdateJoin:
    94  		return b.buildUpdateJoin(ctx, n, row)
    95  	case *plan.Call:
    96  		return b.buildCall(ctx, n, row)
    97  	case *plan.Close:
    98  		return b.buildClose(ctx, n, row)
    99  	case *plan.Describe:
   100  		return b.buildDescribe(ctx, n, row)
   101  	case *plan.ExecuteQuery:
   102  		return b.buildExecuteQuery(ctx, n, row)
   103  	case *plan.ProcedureResolvedTable:
   104  		return b.buildProcedureResolvedTable(ctx, n, row)
   105  	case *plan.ShowTriggers:
   106  		return b.buildShowTriggers(ctx, n, row)
   107  	case *plan.BeginEndBlock:
   108  		return b.buildBeginEndBlock(ctx, n, row)
   109  	case *plan.AlterDB:
   110  		return b.buildAlterDB(ctx, n, row)
   111  	case *plan.Grant:
   112  		return b.buildGrant(ctx, n, row)
   113  	case *plan.Open:
   114  		return b.buildOpen(ctx, n, row)
   115  	case *plan.ChangeReplicationFilter:
   116  		return b.buildChangeReplicationFilter(ctx, n, row)
   117  	case *plan.StopReplica:
   118  		return b.buildStopReplica(ctx, n, row)
   119  	case *plan.ShowVariables:
   120  		return b.buildShowVariables(ctx, n, row)
   121  	case *plan.Sort:
   122  		return b.buildSort(ctx, n, row)
   123  	case *plan.SubqueryAlias:
   124  		return b.buildSubqueryAlias(ctx, n, row)
   125  	case *plan.SetOp:
   126  		return b.buildSetOp(ctx, n, row)
   127  	case *plan.IndexedTableAccess:
   128  		return b.buildIndexedTableAccess(ctx, n, row)
   129  	case *plan.TableAlias:
   130  		return b.buildTableAlias(ctx, n, row)
   131  	case *plan.AddColumn:
   132  		return b.buildAddColumn(ctx, n, row)
   133  	case *plan.RenameColumn:
   134  		return b.buildRenameColumn(ctx, n, row)
   135  	case *plan.DropDB:
   136  		return b.buildDropDB(ctx, n, row)
   137  	case *plan.Distinct:
   138  		return b.buildDistinct(ctx, n, row)
   139  	case *plan.Having:
   140  		return b.buildHaving(ctx, n, row)
   141  	case *plan.Signal:
   142  		return b.buildSignal(ctx, n, row)
   143  	case *plan.TriggerRollback:
   144  		return b.buildTriggerRollback(ctx, n, row)
   145  	case *plan.ExternalProcedure:
   146  		return b.buildExternalProcedure(ctx, n, row)
   147  	case *plan.Into:
   148  		return b.buildInto(ctx, n, row)
   149  	case *plan.LockTables:
   150  		return b.buildLockTables(ctx, n, row)
   151  	case *plan.Truncate:
   152  		return b.buildTruncate(ctx, n, row)
   153  	case *plan.DeclareHandler:
   154  		return b.buildDeclareHandler(ctx, n, row)
   155  	case *plan.DropProcedure:
   156  		return b.buildDropProcedure(ctx, n, row)
   157  	case *plan.ChangeReplicationSource:
   158  		return b.buildChangeReplicationSource(ctx, n, row)
   159  	case *plan.Max1Row:
   160  		return b.buildMax1Row(ctx, n, row)
   161  	case *plan.Rollback:
   162  		return b.buildRollback(ctx, n, row)
   163  	case *plan.Limit:
   164  		return b.buildLimit(ctx, n, row)
   165  	case *plan.RecursiveCte:
   166  		return b.buildRecursiveCte(ctx, n, row)
   167  	case *plan.ShowColumns:
   168  		return b.buildShowColumns(ctx, n, row)
   169  	case *plan.ShowTables:
   170  		return b.buildShowTables(ctx, n, row)
   171  	case *plan.ShowCreateDatabase:
   172  		return b.buildShowCreateDatabase(ctx, n, row)
   173  	case *plan.DropIndex:
   174  		return b.buildDropIndex(ctx, n, row)
   175  	case *plan.ResetReplica:
   176  		return b.buildResetReplica(ctx, n, row)
   177  	case *plan.ShowCreateTrigger:
   178  		return b.buildShowCreateTrigger(ctx, n, row)
   179  	case *plan.TableCopier:
   180  		return b.buildTableCopier(ctx, n, row)
   181  	case *plan.DeclareVariables:
   182  		return b.buildDeclareVariables(ctx, n, row)
   183  	case *plan.Filter:
   184  		return b.buildFilter(ctx, n, row)
   185  	case *plan.Kill:
   186  		return b.buildKill(ctx, n, row)
   187  	case *plan.ShowPrivileges:
   188  		return b.buildShowPrivileges(ctx, n, row)
   189  	case *plan.AlterPK:
   190  		return b.buildAlterPK(ctx, n, row)
   191  	case plan.Nothing:
   192  		return b.buildNothing(ctx, n, row)
   193  	case *plan.RevokeAll:
   194  		return b.buildRevokeAll(ctx, n, row)
   195  	case *plan.DeferredAsOfTable:
   196  		return b.buildDeferredAsOfTable(ctx, n, row)
   197  	case *plan.CreateUser:
   198  		return b.buildCreateUser(ctx, n, row)
   199  	case *plan.AlterUser:
   200  		return b.buildAlterUser(ctx, n, row)
   201  	case *plan.DropView:
   202  		return b.buildDropView(ctx, n, row)
   203  	case *plan.GroupBy:
   204  		return b.buildGroupBy(ctx, n, row)
   205  	case *plan.RowUpdateAccumulator:
   206  		return b.buildRowUpdateAccumulator(ctx, n, row)
   207  	case *plan.Block:
   208  		return b.buildBlock(ctx, n, row)
   209  	case *plan.InsertDestination:
   210  		return b.buildInsertDestination(ctx, n, row)
   211  	case *plan.Set:
   212  		return b.buildSet(ctx, n, row)
   213  	case *plan.TriggerExecutor:
   214  		return b.buildTriggerExecutor(ctx, n, row)
   215  	case *plan.AlterDefaultDrop:
   216  		return b.buildAlterDefaultDrop(ctx, n, row)
   217  	case *plan.CachedResults:
   218  		return b.buildCachedResults(ctx, n, row)
   219  	case *plan.CreateDB:
   220  		return b.buildCreateDB(ctx, n, row)
   221  	case *plan.Revoke:
   222  		return b.buildRevoke(ctx, n, row)
   223  	case *plan.DeclareCondition:
   224  		return b.buildDeclareCondition(ctx, n, row)
   225  	case *plan.TriggerBeginEndBlock:
   226  		return b.buildTriggerBeginEndBlock(ctx, n, row)
   227  	case *plan.RecursiveTable:
   228  		return b.buildRecursiveTable(ctx, n, row)
   229  	case *plan.AlterIndex:
   230  		return b.buildAlterIndex(ctx, n, row)
   231  	case *plan.TransformedNamedNode:
   232  		return b.buildTransformedNamedNode(ctx, n, row)
   233  	case *plan.CreateIndex:
   234  		return b.buildCreateIndex(ctx, n, row)
   235  	case *plan.Procedure:
   236  		return b.buildProcedure(ctx, n, row)
   237  	case *plan.NoopTriggerRollback:
   238  		return b.buildNoopTriggerRollback(ctx, n, row)
   239  	case *plan.With:
   240  		return b.buildWith(ctx, n, row)
   241  	case *plan.Project:
   242  		return b.buildProject(ctx, n, row)
   243  	case *plan.ModifyColumn:
   244  		return b.buildModifyColumn(ctx, n, row)
   245  	case *plan.DeclareCursor:
   246  		return b.buildDeclareCursor(ctx, n, row)
   247  	case *plan.OrderedDistinct:
   248  		return b.buildOrderedDistinct(ctx, n, row)
   249  	case *plan.SingleDropView:
   250  		return b.buildSingleDropView(ctx, n, row)
   251  	case *plan.EmptyTable:
   252  		return b.buildEmptyTable(ctx, n, row)
   253  	case *plan.JoinNode:
   254  		return b.buildJoinNode(ctx, n, row)
   255  	case *plan.RenameUser:
   256  		return b.buildRenameUser(ctx, n, row)
   257  	case *plan.ShowCreateProcedure:
   258  		return b.buildShowCreateProcedure(ctx, n, row)
   259  	case *plan.Commit:
   260  		return b.buildCommit(ctx, n, row)
   261  	case *plan.DeferredFilteredTable:
   262  		return b.buildDeferredFilteredTable(ctx, n, row)
   263  	case *plan.Values:
   264  		return b.buildValues(ctx, n, row)
   265  	case *plan.DropRole:
   266  		return b.buildDropRole(ctx, n, row)
   267  	case *plan.Fetch:
   268  		return b.buildFetch(ctx, n, row)
   269  	case *plan.RevokeRole:
   270  		return b.buildRevokeRole(ctx, n, row)
   271  	case *plan.ShowStatus:
   272  		return b.buildShowStatus(ctx, n, row)
   273  	case *plan.ShowTableStatus:
   274  		return b.buildShowTableStatus(ctx, n, row)
   275  	case *plan.ShowCreateEvent:
   276  		return b.buildShowCreateEvent(ctx, n, row)
   277  	case *plan.SignalName:
   278  		return b.buildSignalName(ctx, n, row)
   279  	case *plan.StartTransaction:
   280  		return b.buildStartTransaction(ctx, n, row)
   281  	case *plan.ValueDerivedTable:
   282  		return b.buildValueDerivedTable(ctx, n, row)
   283  	case *plan.CreateView:
   284  		return b.buildCreateView(ctx, n, row)
   285  	case *plan.InsertInto:
   286  		return b.buildInsertInto(ctx, n, row)
   287  	case *plan.TopN:
   288  		return b.buildTopN(ctx, n, row)
   289  	case *plan.Window:
   290  		return b.buildWindow(ctx, n, row)
   291  	case *plan.DropCheck:
   292  		return b.buildDropCheck(ctx, n, row)
   293  	case *plan.DropTrigger:
   294  		return b.buildDropTrigger(ctx, n, row)
   295  	case *plan.DeallocateQuery:
   296  		return b.buildDeallocateQuery(ctx, n, row)
   297  	case *plan.RollbackSavepoint:
   298  		return b.buildRollbackSavepoint(ctx, n, row)
   299  	case *plan.ReleaseSavepoint:
   300  		return b.buildReleaseSavepoint(ctx, n, row)
   301  	case *plan.Update:
   302  		return b.buildUpdate(ctx, n, row)
   303  	case plan.ShowWarnings:
   304  		return b.buildShowWarnings(ctx, n, row)
   305  	case *plan.Releaser:
   306  		return b.buildReleaser(ctx, n, row)
   307  	case *plan.Concat:
   308  		return b.buildConcat(ctx, n, row)
   309  	case *plan.DeleteFrom:
   310  		return b.buildDeleteFrom(ctx, n, row)
   311  	case *plan.DescribeQuery:
   312  		return b.buildDescribeQuery(ctx, n, row)
   313  	case *plan.ForeignKeyHandler:
   314  		return b.buildForeignKeyHandler(ctx, n, row)
   315  	case *plan.LoadData:
   316  		return b.buildLoadData(ctx, n, row)
   317  	case *plan.ShowCharset:
   318  		return b.buildShowCharset(ctx, n, row)
   319  	case *plan.StripRowNode:
   320  		return b.buildStripRowNode(ctx, n, row)
   321  	case *plan.DropConstraint:
   322  		return b.buildDropConstraint(ctx, n, row)
   323  	case *plan.FlushPrivileges:
   324  		return b.buildFlushPrivileges(ctx, n, row)
   325  	case *plan.Leave:
   326  		return b.buildLeave(ctx, n, row)
   327  	case *plan.While:
   328  		return b.buildWhile(ctx, n, row)
   329  	case *plan.ShowProcessList:
   330  		return b.buildShowProcessList(ctx, n, row)
   331  	case *plan.CreateSavepoint:
   332  		return b.buildCreateSavepoint(ctx, n, row)
   333  	case *plan.CreateCheck:
   334  		return b.buildCreateCheck(ctx, n, row)
   335  	case *plan.AlterDefaultSet:
   336  		return b.buildAlterDefaultSet(ctx, n, row)
   337  	case *plan.DropUser:
   338  		return b.buildDropUser(ctx, n, row)
   339  	case *plan.IfElseBlock:
   340  		return b.buildIfElseBlock(ctx, n, row)
   341  	case *plan.NamedWindows:
   342  		return b.buildNamedWindows(ctx, n, row)
   343  	case *plan.Repeat:
   344  		return b.buildRepeat(ctx, n, row)
   345  	case *plan.RevokeProxy:
   346  		return b.buildRevokeProxy(ctx, n, row)
   347  	case *plan.RenameTable:
   348  		return b.buildRenameTable(ctx, n, row)
   349  	case *plan.CaseStatement:
   350  		return b.buildCaseStatement(ctx, n, row)
   351  	case *plan.GrantRole:
   352  		return b.buildGrantRole(ctx, n, row)
   353  	case *plan.GrantProxy:
   354  		return b.buildGrantProxy(ctx, n, row)
   355  	case *plan.Offset:
   356  		return b.buildOffset(ctx, n, row)
   357  	case *plan.StartReplica:
   358  		return b.buildStartReplica(ctx, n, row)
   359  	case *plan.AlterAutoIncrement:
   360  		return b.buildAlterAutoIncrement(ctx, n, row)
   361  	case *plan.DropForeignKey:
   362  		return b.buildDropForeignKey(ctx, n, row)
   363  	case *plan.DropTable:
   364  		return b.buildDropTable(ctx, n, row)
   365  	case *plan.JSONTable:
   366  		return b.buildJSONTable(ctx, n, row)
   367  	case *plan.UnlockTables:
   368  		return b.buildUnlockTables(ctx, n, row)
   369  	case *plan.Exchange:
   370  		return b.buildExchange(ctx, n, row)
   371  	case *plan.ExchangePartition:
   372  		return b.buildExchangePartition(ctx, n, row)
   373  	case *plan.HashLookup:
   374  		return b.buildHashLookup(ctx, n, row)
   375  	case *plan.Iterate:
   376  		return b.buildIterate(ctx, n, row)
   377  	case sql.ExecSourceRel:
   378  		// escape hatch for custom data sources
   379  		return n.RowIter(ctx, row)
   380  	case *plan.CreateSpatialRefSys:
   381  		return b.buildCreateSpatialRefSys(ctx, n, row)
   382  	default:
   383  		return nil, fmt.Errorf("exec builder found unknown Node type %T", n)
   384  	}
   385  }