Configure a BigQuery data source
Before migrating data with MaxCompute Migration Service (MMS), add and start a BigQuery data source, ensure network connectivity with MMS, and synchronize BigQuery metadata to MMS for configuring migration jobs.
Migrating data costs
MMS data migration consumes resources and incurs charges. The main costs are:
MMS operation | Billing item | Charged by |
| Compute fee: Spark jobs run on MaxCompute consume compute resources. | Alibaba Cloud MaxCompute |
Source data storage | Storage fee: Charged when accessing stored files in object storage such as OSS or S3. | BigQuery |
If you enable data validation for the migration job | Compute fee: Validation SQL statements run separately on Hive and MaxCompute. | Alibaba Cloud MaxCompute and BigQuery |
Network configuration | Network fee:
| Leased-line provider or Alibaba Cloud Network |
To reduce migration costs, use subscription compute resources and dedicated Data Transmission Service resources. For more information, see subscription and dedicated Data Transmission Service resources.
Procedure
You have completed the preparations for the destination MaxCompute project.
Step 1: Prepare the external data source
In BigQuery, complete the following steps:
A BigQuery service account has been created and its authentication JSON file downloaded.
Create a BigQuery project. Grant the service account permissions to read metadata and data from this project.
Step 2: Add a data source
Log in to the MaxCompute console and select a region in the upper-left corner.
In the left-side navigation pane, choose .
On the Data Source tab, click Add Data Source.
To create the service-linked role, click OK in the MaxCompute Service-linked Role dialog box. If this dialog box does not appear, the role already exists.
On the Add Data Source page, configure the data source and click Add.
Data Source Basic Information
Parameter Name
Required
Description
Data Source Name
Yes
A custom name for the data source. Use only letters, digits, and Chinese characters. Special characters are not allowed.
Data Source Type
Yes
Select BigQuery.
Network Connection
Yes
Select a network connection.
Create network connections in the MaxCompute module. These connections let MMS communicate with your VPC and reach your data source.
Service account key file json
Yes
The JSON key file for your BigQuery service account.
Create the service account in the BigQuery IAM console. Then download its authentication JSON file. For more information, see Service account overview.
Workspace ID
Yes
The BigQuery project that contains the data to migrate.
Default destination MaxCompute project
Yes
The MaxCompute project to map data to. You cannot change this later.
Destination MaxCompute project list
No
To migrate data from one data source to multiple MaxCompute projects, list those projects here.
Project whose quota will be used for sql
Yes
The MaxCompute project where Spark and SQL migration jobs run. This project’s default compute quota is used.
Other information
The following parameters are optional. Configure them as needed.
Parameter Name
Description
Change Range Partition Table as
How to handle BigQuery range-partitioned tables.
Partition (Default)
Cluster
CompressionCodec
The compression type for BigQuery data.
BigQuery type BigNumeric default precision
The precision for BigQuery Bignumeric data. Default is 38.
BigQuery type Bignumeric default scale
The scale for BigQuery Bignumeric data. Default is 18.
Auto partition
(Enabled by default) Auto partitioning.
Force the use of Append 2.0 table
(Enabled by default) Force the target table to use Append 2.0.
BigQuery execution project
The BigQuery project where jobs run.
Metastore scheduled update
Whether to pull metadata on a schedule. Options:
Enable: Pull metadata on a schedule. Set the Update Cycle to daily or hourly. Set the Update Started At.
Daily: Runs once per day at a specific minute within 24 hours.
Hourly: Runs once per hour at a specific minute within 60 minutes.
Disable: Do not pull metadata on a schedule.
Api concurrent access number of meta
The number of concurrent requests to access the MaxCompute Metastore. Increases speed when retrieving MaxCompute metadata.
Dataset whitelist
The BigQuery datasets to migrate. Separate multiple datasets with commas (,).
Dataset Blacklist
The BigQuery datasets to skip. Separate multiple datasets with commas (,).
Table Blacklist
The BigQuery tables to skip.
Format each table as
dbname.tablename. Separate multiple tables with commas (,).Table Whitelist
The BigQuery tables to migrate.
Format each table as
dbname.tablename. Separate multiple tables with commas (,).Maximum concurrent migration tasks
Set as needed.
Flags for MaxCompute SQL execution
SQL flags. For a list, see flag parameters.
Table Name Character Mapping
Map characters in BigQuery table names. For example, map hyphens (
-) to underscores (_) in MaxCompute table names.
Step 3: Synchronize metadata
After you start the data source, MMS creates a job instance that connects to the data source and synchronizes its metadata to MMS. This metadata is required for configuring migration jobs.
This job instance uses 4 CU of compute resources. If no migration or metadata sync jobs are queued or running, MMS shuts down the data source. Restart it before use.
On the Data Source tab, for the target data source, click Update metadata in the Actions column.
The Data Source tab shows the Status of the target data source.
If metadata changes occur and you enabled metastore scheduled update, MMS updates metadata automatically on schedule. No manual sync is needed.
After configuring the data source, create a migration job.