Connect to CelerData Cloud Serverless

CelerData Cloud Serverless offers different software editions to suit your analytical requirements and cost plan. You can use CelerData to directly query data from data lakes or load data from various data sources into CelerData-managed tables for low-latency, cost-effective, accelerated queries.

Before using CelerData to query data, you must first establish a connection between your application and CelerData. CelerData provides many connection methods to make the connection easy, including a native SQL editor, MySQL client, JDBC, and other MySQ-compliant applications.

Connect via SQL Editor

CelerData provides a native SQL Editor on the console. You can use the SQL Editor to perform tasks that would normally be performed using SQL.

Follow these steps to connect to CelerData via SQL Editor:

  1. Sign in to the CelerData Cloud Serverless console.
  2. In the left-side navigation pane, choose SQL Editor.

connect_sql_editor

SQL Editor consists of three areas:

  • Data explorer and Saved queries panels
  • Query Editor area
  • Result area

Data explorer and Saved queries panels

On the Data explorer panel, you can:

  • Select the catalog that hosts your data.
  • Select the database that you want to use. You can select a database only after its parent catalog is selected.
  • View and search for tables, views, and materialized views in the selected database.
  • View the Details and Definition of a specific table by hovering on the table.
  • Interact with a specific table by clicking the More (...) button next to the table.
  • View the columns of a specific table by clicking the table.
  • View the details of a specific column by hovering on the column.
  • Interact with a specific column by clicking the More (...) button next to the column.
  • View, search, and interact with views in the selected database.
  • View, search, and interact with materialized views in the selected database.

On the Saved queries panel, you can:

  • View and search for saved queries.
  • Load a saved query script by clicking the query.
  • Create a new query script by clicking the Create a new query button.
  • Create a folder to manage your queries by clicking the Create a new folder button.
  • Rename or delete a saved query by clicking the More (...) button next to the query.

Query Editor area

In the Query Editor area, you can:

  • Edit a query script in the editor.
  • Select the warehouse that you want to use from the warehouse drop-down list in the upper-right corner. If the warehouse is not running, click Quick resume next to it to resume the warehouse.
  • Create a new query script by clicking the + button.
  • Run a query script by clicking the Run button.

NOTE

Your query script is automatically saved when you edit it.

Query Result area

In the Result area, you can:

  • Check the query results and the Query ID, Execution time, Rows returned, and Rows Total of the query after it is completed.
  • Download the query results as an .xlsx file by clicking the Download result button after the query is completed.
  • View the query profile by clicking View query profile.
  • Load data from your cloud storage by clicking the Load data button.
  • Format the SQL in the editor by clicking the Format your SQL button.
  • Check the keyboard shortcuts the Query Editor supports by clicking the Hot key button.

Different information will be displayed in the result section during different phases of the query execution:

  • When the query is running, the result section displays the amount of time that the query has taken.
  • When the query is completed, the result section displays the results of the query.
  • If the query fails, the result section will display the error message.

Connect via MySQL client

In the Query endpoint section of the homepage, click Help me connect. In the displayed dialog box, you can choose to connect to CelerData via a MySQL client, JDBC, or other applications.

connect_from_mysql

To connect to CelerData via a MySQL client, you must have MySQL client 8.0 or later installed on your machine. In addition, make sure your server can access CelerData Cloud Serverless through the network.

Follow these steps to connect to CelerData via a MySQL client:

  1. Launch a terminal, and run the following command:

    mysql -h <celerdata_cloud_endpoint> -P 3306 -u <account_id>.<username> -p
    • Replace <celerdata_cloud_endpoint> with the endpoint of your CelerData cloud account.
    • Replace <account_id> with the ID of your CelerData cloud account.
    • Replace <username> with the username you use to log in to CelerData.

    TIP

    You can copy the complete command string from your CelerData console by following these steps:

    1. Log in to the CelerData Cloud Serverless console.
    2. On the Homepage, click Help me connect in the lower-right corner.
    3. On the MySQL Client tab, click the copy button next to the connection string to copy the command string.
  2. Enter the password you use to log in to CelerData, and press Enter.

Now, you are connected to CelerData. You can run SQL queries in your terminal.

Connect via JDBC

connect_jdbc

Make sure your server can access CelerData Cloud Serverless through the network and the warehouse you use to query data is in the running state.

To connect to CelerData via JDBC, you need to integrate the following configuration string into your code.

NOTE

The parameters you define in the connection string determine whether you directly access a Celerdata-managed table or the data lake. If you choose default_catalog, you can continue to choose a database, which means you are going to access a Celerdata-managed table. If you choose an external catalog, the Choose database option is grayed and you are going to directly access a data lake.

# Connection string if the destination database is not specified:
jdbc:mysql://<celerdata_cloud_endpoint>:3306?user=<account_id>.<username>&password=<password>&sessionVariables=warehouse=<warehouse>&sessionVariables=catalog=<catalog>

# Connection string if the destination database is specified:
jdbc:mysql://<celerdata_cloud_endpoint>:3306/<database>?user=<account_id>.<username>&password=<password>&sessionVariables=warehouse=<warehouse>&sessionVariables=catalog=<catalog>
  • Replace <celerdata_cloud_endpoint> with the endpoint of your CelerData cloud account.
  • Replace <account_id> with the ID of your CelerData cloud account.
  • Replace <username> with the username you use to log in to CelerData.
  • Replace <password> with the password you use to log in to CelerData.
  • Replace <warehouse> with the name of the warehouse you want to use to query data.
  • Replace <catalog> with the name of the catalog you want to connect to. If you want to access a Celerdata-managed table, set the catalog to default_catalog. If you want to access external data sources, set the catalog to an external catalog.
  • (Optional) Replace <database> with the database you want to access. Note that you can specify this parameter when you want to access a table in the default_catalog. This parameter is not available if you want to access an external catalog.

TIP

You can copy the complete connection string from your CelerData console by following these steps:

  1. Log in to the CelerData Cloud Serverless console.
  2. On the Homepage, click Help me connect in the lower-right corner.
  3. On the JDBC tab, select the warehouse, catalog, and database from the drop-down lists. Note that you can select a database only when you choose default_catalog. For other catalogs, the Choose database option is grayed.
  4. Click the copy button to copy the command string, and replace <password> in the string with the password you use to log in to CelerData.

Integrate CelerData with other applications

connect_from_other_app

To integrate CelerData with other applications, you need to prepare the following connection properties:

  • The endpoint, or the host of your CelerData cloud account.

  • The query port 3306.

  • The username you use to log in to CelerData, in the format of <account_id>.<username>.

    Note

    The host is region-specific. To connect to CelerData and complete authentication, you must concatenate the account ID and the username of the account into a <account_id>.<username> string, and make sure this string is globally unique.

  • The password you use to log in to CelerData.

  • The database you want to connect to, in the format of <catalog>.<database>.