You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Setting up partitioning and clustering](#setting-up-partitioning-and-clustering)
25
-
-[Step 6: target-tables-config file: force data types and modes](#step-6-target-tables-config-file-force-data-types-and-modes)
25
+
-[Step 6 (Optional): target-tables-config file: force data types and modes](#step-6-optional-target-tables-config-file-force-data-types-and-modes)
26
+
-[Step 7 (Optional): target-tables-config file: rename a field](#step-7-optional-target-tables-config-file-rename-a-field)
26
27
-[Unit tests set up](#unit-tests-set-up)
27
28
-[Config files in this project](#config-files-in-this-project)
28
29
@@ -363,14 +364,11 @@ You can only set up partitioning.
363
364
}}
364
365
```
365
366
366
-
3. Clear you **state.json**, so it's an empty JSON `{}`, because we want to load all data again. Skip this step, if you
367
-
didn't previously load this data in **Step 4** above.
367
+
3. Clear you **state.json**, so it's an empty JSON `{}`, because we want to load all data again. Skip this step, if you didn't previously load this data in **Step 4** above.
368
368
369
-
4. Delete your BigQuery destination table **exchangeratesapi**, because we want to re-load it again from scratch. Skip
370
-
this step, if you didn't previously load this data in **Step 4** above.
369
+
4. Delete your BigQuery destination table **exchangeratesapi**, because we want to re-load it again from scratch. Skip this step, if you didn't previously load this data in **Step 4** above.
371
370
372
-
3. Load data data into BigQuery, while configuring target tables. Pass **target-tables-config.json** as a command line
373
-
argument.
371
+
3. Load data data into BigQuery, while configuring target tables. Pass **target-tables-config.json** as a command line argument.
@@ -379,35 +377,30 @@ You can only set up partitioning.
379
377
```
380
378
381
379
- "^" indicates a new line in Windows Command Prompt. In Mac terminal, use "\\".
382
-
- If you don't want to pass **target-tables-config.json** file as a CLI argument, you can
383
-
add ```"table_config": "target-tables-config.json"``` to your **target-config.json** file. See **Step 3: Configure**
384
-
above.
380
+
- If you don't want to pass **target-tables-config.json** file as a CLI argument, you can add ```"table_config": "target-tables-config.json"``` to your **target-config.json** file. See **Step 3: Configure** above.
385
381
386
382
387
-
6. Verify in BigQuery web UI that partitioning and clustering worked (in our example below, we only set up
388
-
partitioning):
383
+
6. Verify in BigQuery web UI that partitioning and clustering worked (in our example below, we only set up partitioning):
384
+
389
385
390
386
<imgsrc="readme_screenshots/14_Partitioned_Table.png"width="650"alt="Download the service account credential JSON file">
391
387
392
-
### Step 6: target-tables-config file: force data types and modes
388
+
389
+
### Step 6 (Optional): target-tables-config file: force data types and modes
393
390
394
391
#### Problem:
395
392
396
393
- Normally, tap catalog file governs schema of data which will be loaded into target-bigquery.
397
394
- However, sometimes you can get a column of an undesired data type, which is not following your tap-catalog file.
398
395
399
396
#### Solution:
400
-
401
-
- You can force that column to the desired data type by using `force_fields` flag inside your *
402
-
target-tables-config.json* file.
397
+
- You can force that column to the desired data type by using the `force_fields` flag inside your *target-tables-config.json* file.
403
398
404
399
#### Example:
405
-
406
-
- We used this solution to fix `"date_start"` field from `"ads_insights_age_and_gender"` stream from tap-facebook.
407
-
- In tap catalog file, we said we wanted this column to be a **date**.
408
-
- However, the tap generates schema where this column is a **string**, despite our tap catalog file.
409
-
- Therefore, we used `force_fields` flag in target-tables-config.json to override what the tap generates and force the
410
-
column to be a date.
400
+
- We used this solution to fix `"date_start"` field from `"ads_insights_age_and_gender"` stream from tap-facebook.
401
+
- In the tap catalog file, we said we wanted this column to be a **date**.
402
+
- However, the tap generates schema where this column is a **string**, despite our tap catalog file.
403
+
- Therefore, we used `force_fields` flag in target-tables-config.json to override what the tap generates and force the column to be a date.
411
404
- Example of *target-tables-config.json* file:
412
405
413
406
```
@@ -425,6 +418,23 @@ You can only set up partitioning.
425
418
}
426
419
```
427
420
421
+
### Step 7 (Optional): target-tables-config file: rename a field
422
+
423
+
#### Problem and solution:
424
+
- You can rename a field, using the `force_fields` flag inside your *target-tables-config.json* file.
425
+
426
+
#### Example:
427
+
- Example of *target-tables-config.json* file where we renamed a field from `old_name` to `new_name`:
0 commit comments