如图,在pyspark中可以调用explain,但explain analyze不行。是pyspark有什么限制么?
>>> spark.sql("explain analyze select * from test.t1").collect()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/shawnyan/spark-3.3.1-bin-hadoop2/python/pyspark/sql/session.py", line 1034, in sql
return DataFrame(self._jsparkSession.sql(sqlQuery), self)
File "/home/shawnyan/spark-3.3.1-bin-hadoop2/python/lib/py4j-0.10.9.5-src.zip/py4j/java_gateway.py", line 1322, in __call__
File "/home/shawnyan/spark-3.3.1-bin-hadoop2/python/pyspark/sql/utils.py", line 196, in deco
raise converted from None
pyspark.sql.utils.ParseException:
Syntax error at or near 'select'(line 1, pos 16)
== SQL ==
explain analyze select * from test.t1
----------------^^^