You can use Hue to execute SparkSql statements in a cluster on a graphical user interface (GUI).
Before using the SparkSql editor, you need to modify the Spark2x configuration.
Parameter |
Value |
|---|---|
spark.thriftserver.proxy.enabled |
false |
spark.scheduler.allocation.file |
#{conf_dir}/fairscheduler.xml |
Set hadoop.proxyuser.hue.groups to *.
Set hadoop.proxyuser.hue.hosts to *.
and choose SparkSql. The SparkSql page is displayed.SparkSql supports the following functions:
The system displays all available tables. You can enter a keyword of the table name to search for the desired table.
Move the cursor to the row of the table and click
. Column details are displayed.
Click the triangle next to
and select Explain. The editor checks the syntax and execution plan of the entered statements. If the statements have syntax errors, the editor reports Error while compiling statement.
to execute the SparkSql statement.
to save them.Click
in the upper right corner to configure information such as files, functions, and settings.
Click
in the upper right corner to view the syntax and keyboard shortcut information.
and select Format.
and select Clear.Click Query History to view the SparkSql running status. You can view the history of all the statements or only the saved statements. If many historical records exist, you can enter keywords in the text box to search for desired records.