Warning
This component will be available in the Palette of the studio on the condition that you have subscribed to
one of the Talend solutions with Big
Data.
Component family |
Big Data / Google BigQuery |
|
Function |
This component connects to Google BigQuery and performs queries in |
|
Purpose |
This component performed the queries supported by Google |
|
Basic settings |
Schema and Edit |
A schema is a row description. It defines the number of fields to be processed and passed on Since version 5.6, both the Built-In mode and the Repository mode are Click Edit schema to make changes to the schema. If the
|
|
|
Built-In: You create and store the schema locally for this |
|
|
Repository: You have already created the schema and |
Connection |
Client ID and Client |
Paste the client ID and the client secret, both created and viewable on the API Access tab To enter the client secret, click the […] button next |
Project ID |
Paste the ID of the project hosting the BigQuery service you need to use. The default ID of this project can be found in the URL of the Google API Console, or by |
|
Authorization code |
Paste the authorization code provided by Google for the access you are building. To obtain the authorization code, you need to execute the Job using this component and |
|
Query |
Enter the query you need to use. |
|
Advanced settings |
token properties File Name |
Enter the path to, or browse to the refresh token file you need to use. At the first Job execution using the Authorization code With only the token file name entered, Talend Studio considers the directory of that token file For further information about the refresh token, see the manual of Google BigQuery. |
Advanced Separator (for number) |
Select this check box to change the separator used for the |
|
Encoding |
Select the encoding from the list or select Custom and |
|
tStatCatcher Statistics |
Select this check box to collect the log data at the component |
|
Global Variables |
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see Talend Studio |
|
Usage |
This is an input component. It sends the extracted data to the |
|
Log4j |
The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html. |
|
Limitation |
N/A |
This scenario uses two components to perform the SELECT query in BigQuery and present
the result in the Studio.
The following figure shows the schema of the table, UScustomer, we use as example to perform the SELECT query in.
We will select the State records and count the occurrence of each State among those
records.
-
In the Integration perspective
of Studio, create an empty Job, named BigQueryInput for example, from the
Job Designs node in the Repository tree view.For further information about how to create a Job, see the Talend Studio User
Guide. -
Drop tBigQueryInput and tLogRow onto the workspace.
-
Connect them using the Row > Main
link.
Building access to BigQuery
-
Double-click tBigQueryInput to open its
Component view. -
Click Edit schema to open the
editor -
Click the button twice to add two rows and enter the names of
your choice for each of them in the Column
column. In this scenario, they are: States and Count. -
Click OK to validate these changes and
accept the propagation prompted by the pop-up dialog box. -
Navigate to the Google APIs Console in your web browser to access the
Google project hosting the BigQuery and the Cloud Storage services you need
to use. -
Click the API Access tab to open its view.
-
In the Component view of the Studio,
paste Client ID, Client secret and Project ID from the API Access tab view
to the corresponding fields, respectively.
Getting Authorization code
-
In the Run view of the Studio, click
Run to execute this Job. The execution
will pause at a given moment to print out in the console the URL address
used to get the authorization code. -
Navigate to this address in your web browser and copy the authorization
code displayed. -
In the Component view of tBigQueryInput, paste the authorization code in
the Authorization Code field.
The tLogRow component presents the execution
result of the Job. You can configure the presentation mode on its Component view.
To do this, double-click tLogRow to open the
Component view and in the Mode area, select the Table (print values in
cells of a table) option.
-
To execute this Job, press F6.
Once done, the Run view is opened automatically,
where you can check the execution result.