ADMIN_SPARK stored procedure

The ADMIN_SPARK stored procedure enables you to manage the Db2® Big SQL Spark gateway, which is used in the processing of the SYSHADOOP.EXECSPARK table function. Use this procedure when you want to start, stop, or check the status of the Spark gateway.

Authorization

Only the bigsql user or a user with Db2 Big SQL administrative privileges can run this Hadoop procedure. However, the bigsql user can grant EXECUTE permission on the ADMIN_SPARK procedure to any user, group, or role.

Syntax

Read syntax diagramSkip visual syntax diagram ADMIN_SPARK ( 'start''stop''forcestop''status' )

Description

'start'
The start command launches the Spark gateway, and has no effect if the gateway is already running.
'stop'
The stop command stops the Spark gateway and has no effect if the gateway is not running.
'forcestop'
The forcestop command stops the Spark gateway by killing the operating system processes.
'status'
The status command returns a result set with the location of the Spark gateway's executors.

Usage notes

Call this procedure from a Java™ application that uses a JDBC connection, from another stored procedure, or from the command line.

Example

In the following example, each line in the result set corresponds to an executor and contains the executor’s IP address prefixed by the executor ID. If the gateway is not running, the returned result set is empty. For more information, see Big SQL integration with Apache Spark.
[8.31.105.40][bigsql] 1> call syshadoop.admin_spark('status');
+---------------+
| EXECUTORS     |
+---------------+
| 2|8.31.105.39 |
| 1|8.31.105.42 |
| 3|8.31.105.41 |
+---------------+
3 rows in results(first row: 0.149s; total: 0.262s)