Spark - How can get the Logical / Physical Query execution using - Thirft - Hive Interactor

前端 未结 2 1047
北荒
北荒 2021-01-05 08:54

Spark - How can get the Logical / Physical Query execution using the following

  1. Via Thrift
  2. Via SparkInteractor
2条回答
  •  感情败类
    2021-01-05 09:11

    If you are using Spark 1, You can get the explain on a query this way:

    sqlContext.sql("your SQL query").explain(true)
    

    If you are using Spark 2, it's the same:

    spark.sql("your SQL query").explain(true)
    

    The same logic is available on a dataframe:

    yourDF.explain(true) or yourDF.someOperation.explain(true)
    

    Where someOperation could be maybe a select on a join or something else.

提交回复
热议问题