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

DataWritingCommand Contract — Logical Commands That Write Data

DataWritingCommand Contract — Logical Commands That Write Data

DataWritingCommand is an extension of the Command contract for logical commands that write query data to a relation when executed.

DataWritingCommand is resolved to a DataWritingCommandExec physical operator when BasicOperators execution planning strategy is executed (i.e. plan a logical plan to a physical plan).

Table 1. DataWritingCommand Contract
Property Description

outputColumnNames

The output column names of the analyzed input query plan

Used when DataWritingCommand is requested for the outputColumns

query

The logical query plan representing the data to write (i.e. whose result will be inserted into a relation)

Used when DataWritingCommand is requested for the child nodes and outputColumns.

run

Executes the command

Used when:

When requested for the child nodes, DataWritingCommand simply returns the logical query plan.

DataWritingCommand defines custom performance metrics.

Table 2. DataWritingCommand’s Performance Metrics
Key Name (in web UI) Description

numFiles

number of written files

numOutputBytes

bytes of written output

numOutputRows

number of output rows

numParts

number of dynamic part

The performance metrics are used when:

Table 3. DataWritingCommands (Direct Implementations)
DataWritingCommand Description

CreateDataSourceTableAsSelectCommand

CreateHiveTableAsSelectCommand

InsertIntoHadoopFsRelationCommand

SaveAsHiveFile

Contract for commands that write query result as Hive files

basicWriteJobStatsTracker Method

basicWriteJobStatsTracker simply creates and returns a new BasicWriteJobStatsTracker (with the given Hadoop Configuration and the metrics).

Note

basicWriteJobStatsTracker is used when:

Output Columns — outputColumns Method

outputColumns…​FIXME

Note

outputColumns is used when:

赞(0) 打赏
未经允许不得转载:spark技术分享 » DataWritingCommand Contract — Logical Commands That Write Data
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏