github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/distsql_spec_exec_factory.go (about) 1 // Copyright 2020 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 package sql 12 13 import ( 14 "github.com/cockroachdb/cockroach/pkg/geo/geoindex" 15 "github.com/cockroachdb/cockroach/pkg/sql/opt" 16 "github.com/cockroachdb/cockroach/pkg/sql/opt/cat" 17 "github.com/cockroachdb/cockroach/pkg/sql/opt/constraint" 18 "github.com/cockroachdb/cockroach/pkg/sql/opt/exec" 19 "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" 20 "github.com/cockroachdb/cockroach/pkg/sql/sqlbase" 21 "github.com/cockroachdb/cockroach/pkg/util/errorutil/unimplemented" 22 ) 23 24 type distSQLSpecExecFactory struct { 25 } 26 27 var _ exec.Factory = &distSQLSpecExecFactory{} 28 29 func newDistSQLSpecExecFactory() exec.Factory { 30 return &distSQLSpecExecFactory{} 31 } 32 33 func (e *distSQLSpecExecFactory) ConstructValues( 34 rows [][]tree.TypedExpr, cols sqlbase.ResultColumns, 35 ) (exec.Node, error) { 36 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 37 } 38 39 func (e *distSQLSpecExecFactory) ConstructScan( 40 table cat.Table, 41 index cat.Index, 42 needed exec.TableColumnOrdinalSet, 43 indexConstraint *constraint.Constraint, 44 hardLimit int64, 45 softLimit int64, 46 reverse bool, 47 maxResults uint64, 48 reqOrdering exec.OutputOrdering, 49 rowCount float64, 50 locking *tree.LockingItem, 51 ) (exec.Node, error) { 52 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 53 } 54 55 func (e *distSQLSpecExecFactory) ConstructFilter( 56 n exec.Node, filter tree.TypedExpr, reqOrdering exec.OutputOrdering, 57 ) (exec.Node, error) { 58 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 59 } 60 61 func (e *distSQLSpecExecFactory) ConstructSimpleProject( 62 n exec.Node, cols []exec.NodeColumnOrdinal, colNames []string, reqOrdering exec.OutputOrdering, 63 ) (exec.Node, error) { 64 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 65 } 66 67 func (e *distSQLSpecExecFactory) ConstructRender( 68 n exec.Node, 69 columns sqlbase.ResultColumns, 70 exprs tree.TypedExprs, 71 reqOrdering exec.OutputOrdering, 72 ) (exec.Node, error) { 73 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 74 } 75 76 func (e *distSQLSpecExecFactory) ConstructApplyJoin( 77 joinType sqlbase.JoinType, 78 left exec.Node, 79 rightColumns sqlbase.ResultColumns, 80 onCond tree.TypedExpr, 81 planRightSideFn exec.ApplyJoinPlanRightSideFn, 82 ) (exec.Node, error) { 83 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 84 } 85 86 func (e *distSQLSpecExecFactory) ConstructHashJoin( 87 joinType sqlbase.JoinType, 88 left, right exec.Node, 89 leftEqCols, rightEqCols []exec.NodeColumnOrdinal, 90 leftEqColsAreKey, rightEqColsAreKey bool, 91 extraOnCond tree.TypedExpr, 92 ) (exec.Node, error) { 93 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 94 } 95 96 func (e *distSQLSpecExecFactory) ConstructMergeJoin( 97 joinType sqlbase.JoinType, 98 left, right exec.Node, 99 onCond tree.TypedExpr, 100 leftOrdering, rightOrdering sqlbase.ColumnOrdering, 101 reqOrdering exec.OutputOrdering, 102 leftEqColsAreKey, rightEqColsAreKey bool, 103 ) (exec.Node, error) { 104 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 105 } 106 107 func (e *distSQLSpecExecFactory) ConstructGroupBy( 108 input exec.Node, 109 groupCols []exec.NodeColumnOrdinal, 110 groupColOrdering sqlbase.ColumnOrdering, 111 aggregations []exec.AggInfo, 112 reqOrdering exec.OutputOrdering, 113 ) (exec.Node, error) { 114 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 115 } 116 117 func (e *distSQLSpecExecFactory) ConstructScalarGroupBy( 118 input exec.Node, aggregations []exec.AggInfo, 119 ) (exec.Node, error) { 120 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 121 } 122 123 func (e *distSQLSpecExecFactory) ConstructDistinct( 124 input exec.Node, 125 distinctCols, orderedCols exec.NodeColumnOrdinalSet, 126 reqOrdering exec.OutputOrdering, 127 nullsAreDistinct bool, 128 errorOnDup string, 129 ) (exec.Node, error) { 130 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 131 } 132 133 func (e *distSQLSpecExecFactory) ConstructSetOp( 134 typ tree.UnionType, all bool, left, right exec.Node, 135 ) (exec.Node, error) { 136 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 137 } 138 139 func (e *distSQLSpecExecFactory) ConstructSort( 140 input exec.Node, ordering sqlbase.ColumnOrdering, alreadyOrderedPrefix int, 141 ) (exec.Node, error) { 142 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 143 } 144 145 func (e *distSQLSpecExecFactory) ConstructOrdinality( 146 input exec.Node, colName string, 147 ) (exec.Node, error) { 148 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 149 } 150 151 func (e *distSQLSpecExecFactory) ConstructIndexJoin( 152 input exec.Node, 153 table cat.Table, 154 keyCols []exec.NodeColumnOrdinal, 155 tableCols exec.TableColumnOrdinalSet, 156 reqOrdering exec.OutputOrdering, 157 ) (exec.Node, error) { 158 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 159 } 160 161 func (e *distSQLSpecExecFactory) ConstructLookupJoin( 162 joinType sqlbase.JoinType, 163 input exec.Node, 164 table cat.Table, 165 index cat.Index, 166 eqCols []exec.NodeColumnOrdinal, 167 eqColsAreKey bool, 168 lookupCols exec.TableColumnOrdinalSet, 169 onCond tree.TypedExpr, 170 reqOrdering exec.OutputOrdering, 171 ) (exec.Node, error) { 172 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 173 } 174 175 func (e *distSQLSpecExecFactory) ConstructGeoLookupJoin( 176 joinType sqlbase.JoinType, 177 geoRelationshipType geoindex.RelationshipType, 178 input exec.Node, 179 table cat.Table, 180 index cat.Index, 181 geoCol exec.NodeColumnOrdinal, 182 lookupCols exec.TableColumnOrdinalSet, 183 onCond tree.TypedExpr, 184 reqOrdering exec.OutputOrdering, 185 ) (exec.Node, error) { 186 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 187 } 188 189 func (e *distSQLSpecExecFactory) ConstructZigzagJoin( 190 leftTable cat.Table, 191 leftIndex cat.Index, 192 rightTable cat.Table, 193 rightIndex cat.Index, 194 leftEqCols []exec.NodeColumnOrdinal, 195 rightEqCols []exec.NodeColumnOrdinal, 196 leftCols exec.NodeColumnOrdinalSet, 197 rightCols exec.NodeColumnOrdinalSet, 198 onCond tree.TypedExpr, 199 fixedVals []exec.Node, 200 reqOrdering exec.OutputOrdering, 201 ) (exec.Node, error) { 202 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 203 } 204 205 func (e *distSQLSpecExecFactory) ConstructLimit( 206 input exec.Node, limit, offset tree.TypedExpr, 207 ) (exec.Node, error) { 208 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 209 } 210 211 func (e *distSQLSpecExecFactory) ConstructMax1Row( 212 input exec.Node, errorText string, 213 ) (exec.Node, error) { 214 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 215 } 216 217 func (e *distSQLSpecExecFactory) ConstructProjectSet( 218 n exec.Node, exprs tree.TypedExprs, zipCols sqlbase.ResultColumns, numColsPerGen []int, 219 ) (exec.Node, error) { 220 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 221 } 222 223 func (e *distSQLSpecExecFactory) ConstructWindow( 224 input exec.Node, window exec.WindowInfo, 225 ) (exec.Node, error) { 226 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 227 } 228 229 func (e *distSQLSpecExecFactory) RenameColumns( 230 input exec.Node, colNames []string, 231 ) (exec.Node, error) { 232 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 233 } 234 235 func (e *distSQLSpecExecFactory) ConstructPlan( 236 root exec.Node, subqueries []exec.Subquery, cascades []exec.Cascade, checks []exec.Node, 237 ) (exec.Plan, error) { 238 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 239 } 240 241 func (e *distSQLSpecExecFactory) ConstructExplainOpt( 242 plan string, envOpts exec.ExplainEnvData, 243 ) (exec.Node, error) { 244 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 245 } 246 247 func (e *distSQLSpecExecFactory) ConstructExplain( 248 options *tree.ExplainOptions, stmtType tree.StatementType, plan exec.Plan, 249 ) (exec.Node, error) { 250 // TODO(yuzefovich): make sure to return the same nice error in some 251 // variants of EXPLAIN when subqueries are present as we do in the old path. 252 // TODO(yuzefovich): make sure that local plan nodes that create 253 // distributed jobs are shown as "distributed". See distSQLExplainable. 254 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 255 } 256 257 func (e *distSQLSpecExecFactory) ConstructShowTrace( 258 typ tree.ShowTraceType, compact bool, 259 ) (exec.Node, error) { 260 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 261 } 262 263 func (e *distSQLSpecExecFactory) ConstructInsert( 264 input exec.Node, 265 table cat.Table, 266 insertCols exec.TableColumnOrdinalSet, 267 returnCols exec.TableColumnOrdinalSet, 268 checkCols exec.CheckOrdinalSet, 269 allowAutoCommit bool, 270 skipFKChecks bool, 271 ) (exec.Node, error) { 272 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 273 } 274 275 func (e *distSQLSpecExecFactory) ConstructInsertFastPath( 276 rows [][]tree.TypedExpr, 277 table cat.Table, 278 insertCols exec.TableColumnOrdinalSet, 279 returnCols exec.TableColumnOrdinalSet, 280 checkCols exec.CheckOrdinalSet, 281 fkChecks []exec.InsertFastPathFKCheck, 282 ) (exec.Node, error) { 283 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 284 } 285 286 func (e *distSQLSpecExecFactory) ConstructUpdate( 287 input exec.Node, 288 table cat.Table, 289 fetchCols exec.TableColumnOrdinalSet, 290 updateCols exec.TableColumnOrdinalSet, 291 returnCols exec.TableColumnOrdinalSet, 292 checks exec.CheckOrdinalSet, 293 passthrough sqlbase.ResultColumns, 294 allowAutoCommit bool, 295 skipFKChecks bool, 296 ) (exec.Node, error) { 297 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 298 } 299 300 func (e *distSQLSpecExecFactory) ConstructUpsert( 301 input exec.Node, 302 table cat.Table, 303 canaryCol exec.NodeColumnOrdinal, 304 insertCols exec.TableColumnOrdinalSet, 305 fetchCols exec.TableColumnOrdinalSet, 306 updateCols exec.TableColumnOrdinalSet, 307 returnCols exec.TableColumnOrdinalSet, 308 checks exec.CheckOrdinalSet, 309 allowAutoCommit bool, 310 skipFKChecks bool, 311 ) (exec.Node, error) { 312 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 313 } 314 315 func (e *distSQLSpecExecFactory) ConstructDelete( 316 input exec.Node, 317 table cat.Table, 318 fetchCols exec.TableColumnOrdinalSet, 319 returnCols exec.TableColumnOrdinalSet, 320 allowAutoCommit bool, 321 skipFKChecks bool, 322 ) (exec.Node, error) { 323 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 324 } 325 326 func (e *distSQLSpecExecFactory) ConstructDeleteRange( 327 table cat.Table, 328 needed exec.TableColumnOrdinalSet, 329 indexConstraint *constraint.Constraint, 330 interleavedTables []cat.Table, 331 maxReturnedKeys int, 332 allowAutoCommit bool, 333 ) (exec.Node, error) { 334 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 335 } 336 337 func (e *distSQLSpecExecFactory) ConstructCreateTable( 338 input exec.Node, schema cat.Schema, ct *tree.CreateTable, 339 ) (exec.Node, error) { 340 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 341 } 342 343 func (e *distSQLSpecExecFactory) ConstructCreateView( 344 schema cat.Schema, 345 viewName string, 346 ifNotExists bool, 347 replace bool, 348 temporary bool, 349 viewQuery string, 350 columns sqlbase.ResultColumns, 351 deps opt.ViewDeps, 352 ) (exec.Node, error) { 353 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 354 } 355 356 func (e *distSQLSpecExecFactory) ConstructSequenceSelect(sequence cat.Sequence) (exec.Node, error) { 357 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 358 } 359 360 func (e *distSQLSpecExecFactory) ConstructSaveTable( 361 input exec.Node, table *cat.DataSourceName, colNames []string, 362 ) (exec.Node, error) { 363 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 364 } 365 366 func (e *distSQLSpecExecFactory) ConstructErrorIfRows( 367 input exec.Node, mkErr func(tree.Datums) error, 368 ) (exec.Node, error) { 369 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 370 } 371 372 func (e *distSQLSpecExecFactory) ConstructOpaque(metadata opt.OpaqueMetadata) (exec.Node, error) { 373 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 374 } 375 376 func (e *distSQLSpecExecFactory) ConstructAlterTableSplit( 377 index cat.Index, input exec.Node, expiration tree.TypedExpr, 378 ) (exec.Node, error) { 379 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 380 } 381 382 func (e *distSQLSpecExecFactory) ConstructAlterTableUnsplit( 383 index cat.Index, input exec.Node, 384 ) (exec.Node, error) { 385 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 386 } 387 388 func (e *distSQLSpecExecFactory) ConstructAlterTableUnsplitAll(index cat.Index) (exec.Node, error) { 389 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 390 } 391 392 func (e *distSQLSpecExecFactory) ConstructAlterTableRelocate( 393 index cat.Index, input exec.Node, relocateLease bool, 394 ) (exec.Node, error) { 395 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 396 } 397 398 func (e *distSQLSpecExecFactory) ConstructBuffer( 399 input exec.Node, label string, 400 ) (exec.BufferNode, error) { 401 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 402 } 403 404 func (e *distSQLSpecExecFactory) ConstructScanBuffer( 405 ref exec.BufferNode, label string, 406 ) (exec.Node, error) { 407 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 408 } 409 410 func (e *distSQLSpecExecFactory) ConstructRecursiveCTE( 411 initial exec.Node, fn exec.RecursiveCTEIterationFn, label string, 412 ) (exec.Node, error) { 413 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 414 } 415 416 func (e *distSQLSpecExecFactory) ConstructControlJobs( 417 command tree.JobCommand, input exec.Node, 418 ) (exec.Node, error) { 419 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 420 } 421 422 func (e *distSQLSpecExecFactory) ConstructCancelQueries( 423 input exec.Node, ifExists bool, 424 ) (exec.Node, error) { 425 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 426 } 427 428 func (e *distSQLSpecExecFactory) ConstructCancelSessions( 429 input exec.Node, ifExists bool, 430 ) (exec.Node, error) { 431 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 432 } 433 434 func (e *distSQLSpecExecFactory) ConstructExport( 435 input exec.Node, fileName tree.TypedExpr, fileFormat string, options []exec.KVOption, 436 ) (exec.Node, error) { 437 return nil, unimplemented.NewWithIssue(47473, "experimental opt-driven distsql planning") 438 }