Streambased Documentation
  • Home
  • Overview
    • Key Concepts
  • Streambased Cloud
    • Streambased Cloud UI
      • Create your first Streambased cluster
      • Create your first Streambased API Key
      • Running your first A.S.K Query
      • Exploring your data using S.S.K
    • Iceberg Service for Kafka - I.S.K.
      • Overview
      • Architecture
      • Usage
      • Quick Start
    • Analytics Service for Kafka - A.S.K.
      • Overview
      • Architecture
      • Connecting to Streambased A.S.K.
        • Connect Superset to Streambased A.S.K.
        • Connect Jupyter to Streambased A.S.K.
        • Connect a JDBC Client to Streambased A.S.K.
        • Connect an ODBC client to Streambased A.S.K.
        • Connect a Python Application (SQL Alchemy) to Streambased A.S.K.
    • Storage Service for Kafka - S.S.K.
      • Overview
      • Connecting to Streambased S.S.K.
        • Connecting a S3 compatible client to Streambased S.S.K.
        • Connect a S3manager to Streambased S.S.K.
  • Streambased Platform
    • Overview
    • Requirements
    • Step by Step Installation
    • Configuration
    • Connecting Analytical Applications to Streambased
      • Connect Superset to Streambased
      • Connect Jupyter to Streambased
      • Connect a JDBC Client to Streambased
      • Connect an ODBC client to Streambased
      • Connect a Python Application (SQL Alchemy) to Streambased
Powered by GitBook
On this page
  • Prerequisites:
  • Step 1: Create a database engine
  • Step 2: Connect to the database
  • Step 3: Run a query
  1. Streambased Platform
  2. Connecting Analytical Applications to Streambased

Connect Jupyter to Streambased

Jupyter notebooks are used for exploratory data analysis, data cleaning, data visualization, statistical modeling, machine learning, and deep learning. Let's bring real-time data into the mix.

PreviousConnect Superset to StreambasedNextConnect a JDBC Client to Streambased

Last updated 3 months ago

Prerequisites:

  • A running Streambased instance, for instructions see

  • A running Jupyter deployment that has the following additional packages:

    • jupysql

    • sqlalchemy-trino

Step 1: Create a database engine

In a new notebook execute the following:

from sqlalchemy.engine import create_engine
engine = create_engine("trino://[server host]:[server port]/kafka",
                       connect_args ={"http_scheme":"https", "schema":"streambased"})

By default server port is 8080 and server host is the name of the host on which the docker instance has been launched.

Step 2: Connect to the database

From your notebook run the following to load the SQL extension and the open the previously created engine:

%load_ext sql
%sql engine

Step 3: Run a query

Using the SQL extension we can execute anything we like. Happy querying!

%sql SELECT * FROM demo_transactions

here