关注 spark技术分享,
撸spark源码 玩spark最佳实践

RunnableCommand Contract — Generic Logical Command with Side Effects

RunnableCommand Contract — Generic Logical Command with Side Effects

RunnableCommand is the generic logical command that is executed eagerly for its side effects.

RunnableCommand defines one abstract method run that computes a collection of Row records with the side effect, i.e. the result of executing a command.

Note
RunnableCommand logical operator is resolved to ExecutedCommandExec physical operator in BasicOperators execution planning strategy.
Note

run is executed when:

Table 1. Available RunnableCommands
RunnableCommand Description

AddFileCommand

AddJarCommand

AlterDatabasePropertiesCommand

AlterTableAddPartitionCommand

AlterTableChangeColumnCommand

AlterTableDropPartitionCommand

AlterTableRecoverPartitionsCommand

AlterTableRenameCommand

AlterTableRenamePartitionCommand

AlterTableSerDePropertiesCommand

AlterTableSetLocationCommand

AlterTableSetPropertiesCommand

AlterTableUnsetPropertiesCommand

AlterViewAsCommand

AnalyzeColumnCommand

AnalyzePartitionCommand

AnalyzeTableCommand

CacheTableCommand

When executed, CacheTableCommand creates a DataFrame followed by registering a temporary view for the optional query.

CacheTableCommand requests the session-specific Catalog to cache the table.

Note
CacheTableCommand uses SparkSession to access the Catalog.

If the caching is not LAZY (which is not by default), CacheTableCommand creates a DataFrame for the table and counts the rows (that will trigger the caching).

Note
CacheTableCommand uses a Spark SQL pattern to trigger DataFrame caching by executing count operation.

ClearCacheCommand

CreateDatabaseCommand

CreateDataSourceTableAsSelectCommand

When executed, …​FIXME

Used exclusively when DataSourceAnalysis posthoc logical resolution rule resolves a CreateTable logical operator with queries using non-Hive table providers (which is when DataFrameWriter saves a DataFrame to a non-Hive table or for Create Table As Select SQL statements)

CreateDataSourceTableCommand

CreateFunctionCommand

CreateHiveTableAsSelectCommand

CreateTableCommand

CreateTableLikeCommand

CreateTempViewUsing

CreateViewCommand

DescribeColumnCommand

DescribeDatabaseCommand

DescribeFunctionCommand

DescribeTableCommand

DropDatabaseCommand

DropFunctionCommand

DropTableCommand

ExplainCommand

InsertIntoDataSourceCommand

InsertIntoHadoopFsRelationCommand

InsertIntoHiveTable

ListFilesCommand

ListJarsCommand

LoadDataCommand

RefreshResource

RefreshTable

ResetCommand

SaveIntoDataSourceCommand

When executed, requests DataSource to write a DataFrame to a data source per save mode.

Used exclusively when DataFrameWriter is requested to save a DataFrame to a data source.

SetCommand

SetDatabaseCommand

ShowColumnsCommand

ShowCreateTableCommand

ShowDatabasesCommand

ShowFunctionsCommand

ShowPartitionsCommand

ShowTablePropertiesCommand

ShowTablesCommand

StreamingExplainCommand

TruncateTableCommand

UncacheTableCommand

赞(0) 打赏
未经允许不得转载:spark技术分享 » RunnableCommand Contract — Generic Logical Command with Side Effects
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏