Search code examples
hivepysparkjupyter-notebook

How to enable the spark SQL with %sql Magic string on Hive in pyspark using jupyter notebook


enter image description hereHow to enable the %sql Magic string on jupyter notebook and how to use %sql magic string on a cell with the below line of code.

spark.sql('select * from test').show()

Solution

  • Try

    %%sparksql
    select * from test
    

    Before trying install

    pip install sparksql-magic

    Refer: https://github.com/cryeo/sparksql-magic