Configuring the session

In session mode, all of your jobs share your session cluster, a Flink cluster with its JobManager and TaskManagers. You can view and reset your Cloudera SQL Stream Builder (SSB) session, set session properties, and stop the session cluster.

By default, the jobs that you run use session mode. The session cluster starts when you run your first job in session mode.

On the Projects page and the Configuration page, the header has a tag that indicates whether the session cluster is running, and the Sessions menu with the SSB Session and Session Cluster items. Inside a project, the workspace has only the Session button, which opens the SSB Session panel.

  1. View the session.
    1. In the Streaming SQL Console, click Projects in the left navigation pane, and click the name of your project.

      The project opens, with the Explorer panel on the left. To open the Streaming SQL Console, see Accessing Cloudera SQL Stream Builder.

    2. In the workspace, click Session.

      The SSB Session panel opens. The General tab displays details such as the session ID, the start time, the default catalog and database, and the temporary tables and views. The Properties tab lists all session properties. The User Defined Variables tab lists the variables that you define.

  2. Optional: Optional: Set a session property with the SET statement in the SQL editor, select the statement, and click Execute Selection.
    SET 'state.backend.type' = 'rocksdb';

    A SET statement of the state backend also works for a job in session mode.

  3. Optional: Optional: To clear the configuration of the session, in the SSB Session panel, click Reset Session, and click Reset in the confirmation dialog.
    The properties, the temporary tables and views, and the default catalog and database settings of the session are cleared.
  4. Optional: Optional: To stop the session cluster, stop all jobs that run in it, and then stop the cluster.
    1. Click Projects in the left navigation pane.
    2. In the header of the Projects page, click Sessions, and click Session Cluster.

      The Session Cluster dialog indicates whether the session cluster is running.

    3. Click Stop.

      The session cluster is deleted. It starts again the next time you run a job in session mode.

To open the Streaming SQL Console, see Accessing Cloudera SQL Stream Builder.