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

CreateTempViewUsing

CreateTempViewUsing Logical Command

CreateTempViewUsing is a logical command for creating or replacing a temporary view (global or not) using a data source.

CreateTempViewUsing is created to represent CREATE TEMPORARY VIEW … USING SQL statements.

Executing Logical Command — run Method

Note
run is part of RunnableCommand Contract to execute (run) a logical command.

run creates a DataSource and requests it to resolve itself (i.e. create a BaseRelation).

run then requests the input SparkSession to create a DataFrame from the BaseRelation that is used to get the analyzed logical plan (that is the view definition of the temporary table).

Depending on the global flag, run requests the SessionCatalog to createGlobalTempView (global flag is on) or createTempView (global flag is off).

run throws an AnalysisException when executed with hive provider.

Creating CreateTempViewUsing Instance

CreateTempViewUsing takes the following when created:

  • TableIdentifier

  • Optional user-defined schema (as StructType)

  • replace flag

  • global flag

  • Name of the data source provider

  • Options (as Map[String, String])

argString Method

Note
argString is part of the TreeNode Contract to…​FIXME.

argString…​FIXME

赞(0) 打赏
未经允许不得转载:spark技术分享 » CreateTempViewUsing
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏