RunnableCommand Logical Operators¶
RunnableCommand
is an extension of the Command abstraction for logical commands that can be executed for side effects.
Contract¶
Executing Command¶
run(
sparkSession: SparkSession): Seq[Row]
Executes the command for side effects (possibly giving Row back with the result)
Used when:
- ExecutedCommandExec leaf physical operator is executed (and caches the result)
- InsertIntoHadoopFsRelationCommand is executed
Implementations¶
- AddFileCommand
- AddJarCommand
- AlterDatabasePropertiesCommand
- AlterDatabaseSetLocationCommand
- AlterTableAddColumnsCommand
- AlterTableAddPartitionCommand
- AlterTableChangeColumnCommand
- AlterTableDropPartitionCommand
- AlterTableRecoverPartitionsCommand
- AlterTableRenameCommand
- AlterTableRenamePartitionCommand
- AlterTableSerDePropertiesCommand
- AlterTableSetLocationCommand
- AlterTableSetPropertiesCommand
- AlterTableUnsetPropertiesCommand
- AlterViewAsCommand
- AnalyzeColumnCommand
- AnalyzePartitionCommand
- AnalyzeTableCommand
- CacheTableCommand
- ClearCacheCommand
- CreateDatabaseCommand
- CreateDataSourceTableCommand
- CreateFunctionCommand
- CreateTableCommand
- CreateTableLikeCommand
- CreateTempViewUsing
- CreateViewCommand
- DescribeColumnCommand
- DescribeCommandBase
- DescribeDatabaseCommand
- DescribeFunctionCommand
- DropDatabaseCommand
- DropFunctionCommand
- DropTableCommand
- ExplainCommand
- ExternalCommandExecutor
- InsertIntoDataSourceCommand
- InsertIntoDataSourceDirCommand
- ListFilesCommand
- ListJarsCommand
- LoadDataCommand
- RefreshResource
- RefreshTable
- ResetCommand
- SaveIntoDataSourceCommand
- SetCommand
- ShowColumnsCommand
- ShowCreateTableAsSerdeCommand
- ShowCreateTableCommand
- ShowFunctionsCommand
- ShowPartitionsCommand
- ShowTablePropertiesCommand
- ShowTablesCommand
- ShowViewsCommand
- StreamingExplainCommand
- TruncateTableCommand
- UncacheTableCommand
Query Planning¶
RunnableCommand
logical operators are resolved to ExecutedCommandExec physical operators in BasicOperators execution planning strategy.
Performance Metrics¶
metrics: Map[String, SQLMetric]
RunnableCommand
can define optional performance metrics.
metrics
is empty by default.
Lazy Value
metrics
is a Scala lazy value to guarantee that the code to initialize it is executed once only (when accessed for the first time) and cached afterwards.
metrics
is used when ExecutedCommandExec leaf physical operator is executed (and requested for performance metrics).
Last update: 2020-11-20