Step 5. Create a mapping to load a CSV file into Google BigQuery
Step 5. Create a mapping to load a CSV file into Google BigQuery
In this step, you load a CSV file from the flat file directory configured in flat file connection and write it to a table created during runtime in Google BigQuery. Use the same CSV file that you used in the previous step.
In
Data Integration
, click
New
to open the
New Asset
dialog box.
In the
New Asset
dialog box, click
Mappings
in the menu on the left, select
Mapping
, and click
Create
.
When the mapping opens, enter the mapping name in the
Name
field:
Click the Source transformation in the canvas.
On the
General
tab, update the name of the Source transformation to reflect the actual object.
In this case, the source is a CSV file.
Click the
Source
tab, and perform the following steps:
In the
Connection
field, select the flat file connection that you created.
Click
Select
next to the
Object
field to select the CSV file.
IICS treats flat files as CSV by default. You can change the formatting by clicking
Formatting Options
.
Optionally, click
Preview Data
if you want to view the first few rows of the data file.
Click the Target transformation in the canvas.
On the
General
tab, update the name of the Target transformation to reflect the actual object.
In this case, the target is Google BigQuery.
Click the
Target
tab, and perform the following steps:
In the
Connection
field, select the Google BigQuery V2 connection that you created.
Click
Select
next to the
Object
field to create the target file.
Select
Create New at Runtime
.
In the
Object Name
field, enter the name of the target file that will be created.
In the
Path
field, enter the name of the Google BigQuery dataset where the table will be created:
For information about creating Google BigQuery datasets, see
this GCP guide.
Click
Save
.
Click the
Field Mapping
tab.
When you create a new target object, IICS automatically creates and maps fields from incoming fields, which come from the source dataset in this case, to the target:
Click
Run
in the top right corner of the screen:
Select the runtime environment, and then click
Run
:
Click
My Jobs
to open the job activity page:
The target table is created in the Google BigQuery dataset: