MaxCompute allows you to use the database management tool DataGrip to access MaxCompute
projects and manage data. This topic describes how to use a MaxCompute Java Database
Connectivity (JDBC) driver to connect DataGrip to a MaxCompute project and use DataGrip
to manage data.
Background information
DataGrip is a database management tool for developers. It provides an easy method
for developers to query, create, and manage databases. Databases can work on on-premises
machines, servers, or the cloud. For more information about DataGrip, see DataGrip.
Prerequisites
- A MaxCompute project is created.
For more information about how to create a MaxCompute project, see Create a MaxCompute project.
- The AccessKey pair of your Alibaba Cloud account that is used to access the MaxCompute
project is obtained.
You can click the profile picture in the upper-right corner of the MaxCompute console
and select AccessKey Management to obtain the AccessKey pair.
- The package of MaxCompute JDBC driver V3.2.8 or later is downloaded. This package includes the
jar-with-dependencies
package.
MaxCompute JDBC driver V3.2.9 is used in this topic.
- DataGrip is downloaded and installed.
For more information about how to install DataGrip, see Install DataGrip.
DataGrip 2021.1.3 is used in this topic.
Step 1: Add a MaxCompute JDBC driver
- Start DataGrip.
- Click New Project to create a project named MaxCompute_test.
- On the page that appears, click the
icon. In the Data Sources and Drivers dialog box, click the Drivers tab, add the JAR package of the MaxCompute JDBC driver, configure the Name and Class parameters, and then click Apply.
In the Driver Files section, click the
icon and select Custom JARs...to upload the JAR package of the MaxCompute JDBC driver, odps-jdbc-3.2.9-jar-with-dependencies.jar
, from your on-premises machine.

Parameter |
Description |
Name |
The name of the driver that you want to add, such as MaxCompute. |
Class |
After the JAR package of the MaxCompute JDBC driver is uploaded, select com.aliyun.odps.jdbc.OdpsDriver from the Class drop-down list on the General tab.
|
Step 2: Connect DataGrip to MaxCompute
- On the Data Sources tab of the Data Sources and Drivers dialog box, click the
icon and select the MaxCompute data source. You can also click the
Drivers tab in the
Data Sources and Drivers dialog box and click
Create Data Source to add the MaxCompute data source.

- In the dialog box that appears, configure connection parameters. The following table
describes the connection parameters.

Parameter |
Description |
Name |
The name of the new data connection, which is used to distinguish the connections
of different databases in the system. In this topic, set this parameter to MCtoDG.
|
User |
The AccessKey ID that is used to access the MaxCompute project.
You can click the profile picture in the upper-right corner of the MaxCompute console
and select AccessKey Management to obtain the AccessKey ID.
|
Password |
The AccessKey secret that corresponds to the AccessKey ID.
You can click the profile picture in the upper-right corner of the MaxCompute console
and select AccessKey Management to obtain the AccessKey secret.
|
URL |
The Uniform Resource Locator (URL) that is used to connect to the MaxCompute project.
The format is jdbc:odps:<MaxCompute_endpoint>?project=<MaxCompute_project_name>[&interactiveMode={true|false}] . Delete the angle brackets (<>) when you configure this parameter. Parameters:
- <MaxCompute_endpoint>: required. The endpoint of MaxCompute. Configure this parameter based on the region
where the MaxCompute project resides.
For more information about the endpoints of MaxCompute in different regions, see Endpoints.
- <MaxCompute_project_name>: required. The name of the MaxCompute project to which you want to connect Tableau.
This parameter specifies the name of your MaxCompute project instead of the DataWorks
workspace to which the MaxCompute project corresponds. You can log on to the MaxCompute console, select the region where your MaxCompute project resides in the top navigation bar,
and then view the name of the MaxCompute project on the Project management tab.
- interactiveMode: optional. This parameter specifies whether to enable the MaxCompute Query Acceleration
(MCQA) feature.
If you want to enable the MCQA feature, add &interactiveMode=true to the end of the URL. For more information about the MCQA feature, see Query acceleration.
|
- Click Test Connection. If the message shown in the following figure appears, click OK.
Step 3: Use DataGrip to manage the MaxCompute project
After you connect DataGrip to MaxCompute, you can view the established connection
in the left panel. You can write SQL scripts to manage the MaxCompute project. For
more information, see the
DataGrip help information.
- Query all existing tables
You can query the information of all existing tables that are listed under the established
MaxCompute connection.

- Query table schema
You can click the table that you want to query under the established MaxCompute connection,
write SQL scripts in the right-side SQL code editor, and execute the SQL scripts to
query the schema of the table.

- Query table data
You can click the table that you want to query under the established MaxCompute connection,
write SQL scripts in the right-side SQL code editor, and execute the SQL scripts to
query the data of the table.
