BigQuery is Google’s fully managed, petabyte scale, low cost analytics data warehouse that enables users with super-fast SQL queries using the processing power of Google’s infrastructure.
Information Server provides a native BigQuery Connector to read/write data from/to the tables on BigQuery and integrate it into the ETL job design.
We demonstrate a sample use case here which performs a write operation on BigQuery using BigQuery Connector. The datastage job includes a DB2 Connector as source stage and a BigQuery Connector¬† as target, where the data from DB2 is written to a table stored on Google BigQuery, moving data from OnPremise environment on to cloud.
In this recipe, I will show you how we can configure BigQuery Connector properties to write data to Google BigQuery from DB2.
Configure DB2 connector as source
1. Provide Database, Username and Password details for DB2, in the connection properties of DB2 Connector as follows:
2. Select Generate SQL option to auto-generate the select statement.
3. Provide the DB2 Table name, where the data to be read is present.
Configure BigQuery Connector Properties to write to Google BigQuery
1. Download the Google service account credentials json file and copy it to any location on Engine tier.
2. Provide the fully qualified path to the above json file under Credentials file in the Connection Properties as follows:
3. Provide the Schema name property in which the table has to reside.
4. Provide the Table name property to which data has to be written from DB2. If the table doesn’t already exist, it will be created during the job run and then the data will be written to the table. If the table already exists, it will be appended with the data from the job.
5. Under Input tab, provide the column name and type details of data, that needs to be written to Google BigQuery as follows:
6. Compile and run the job. The data from DB2 table is written to the BigQuery table.
When Datastage is configured to run on multiple nodes, each node writes a chunk of data in parallel to the BigQuery table.