Querying from DataGrip

Using Ascend's JDBC / ODBC Connection, developers can query Ascend directly from SQL tools like DataGrip.

Although this article will go through the setup for DataGrip, the steps should be very similar to other tools.

Connecting To DataGrip

  1. Create a new database. For the data source type, prefer Apache Spark if present, otherwise use Apache Hive.

🚧

Using the Apache Hive Driver

The Apache Hive Driver that ships with DataGrip is version 3 and Spark is only compatible up to version 2.3.7. If you encounter difficult connecting, you will likely need to download the Hive Standalone JAR for 2.3.7 from Maven Central and use that JAR instead of the one embedded in DataGrip.

  1. Fill in the host with your Ascend domain in the format <ascend-subdomain>.sql.ascend.io.
  2. Fill in the port as 10000

  1. Enter the Username and Password from an API Token linked to a Service Account.
  2. Append ssl=true to the URL.

  1. Test the connection to ensure the setup is correct.
  2. Switch to the Options tab to enable the connection as "Read-only".
  3. Disable automatic schema switching.

  1. Create the database.
  2. By default DataGrip does not include any schemas. Click the database connection, select “All schemas”, then hit the "Refresh" icon.

  1. The DataGrip catalog should be filled in, with each Dataflow should be present as a different schema with each component mapped as a table.

  1. Click on a table to view the records from that component.

This style of working makes it really easy to explore our data as we're building our pipelines. The SQL syntax is standard Spark SQL so we are free to use the full capabilities of the language.