Getting cube.dev quickstart to work with StarRocks

Note

We are using Getting started with Cube Cloud and Snowflake | Cube Docs as the start point with the cube.dev container at GitHub - cube-js/cube: 📊 Cube — The Semantic Layer for Building Data Applications

Changes to “Load Data” section

StarRocks doesn’t not have warehouse or schema. So we only need:

CREATE DATABASE cube_demo;

We also need to modify the create table statements.

CREATE TABLE cube_demo.line_items
( id INTEGER,
  order_id INTEGER,
  product_id INTEGER,
  price INTEGER,
  created_at DATETIME
);

CREATE TABLE cube_demo.orders
( id INTEGER,
  user_id INTEGER,
  status VARCHAR(80),
  completed_at DATETIME,
  created_at DATETIME
);

CREATE TABLE cube_demo.users
( id INTEGER,
  user_id INTEGER,
  city VARCHAR(80),
  age INTEGER,
  gender VARCHAR(80),
  state VARCHAR(80),
  first_name VARCHAR(80),
  last_name VARCHAR(80),
  created_at DATETIME
);

CREATE TABLE cube_demo.products
( id INTEGER,
  name VARCHAR(100),
  product_category VARCHAR(100),
  created_at DATETIME
);

You can either import the CSV data using HTTP or Broker (#22783) or use can use a tool like DBeaver’s Data Import tool.

Changes to “Connect to Database” section

Pick the “mysql” connection and use the following

Important

I’m using the StarRocks quickstart container on my local machine.

  • DB Host: host.docker.internal
  • DB Port: 9030
  • DB Name: cube_demo
  • DB User: root
  • DB Password:

Changes to “Create Data Model” section

None.

Changes to “query from BI” section

None.

Changes to “Query from React” section

None.