Skip to content

Commit f7ec21f

Browse files
authored
Merge pull request embulk#5 from giwa/add-description-for-column-option
2 parents 06355af + 10b8b97 commit f7ec21f

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.4 - 2019-11-06
2+
3+
* [enhancement] Add DATETIME type conveter (thanks to @kekekenta)
4+
15
## 0.6.3 - 2019-10-28
26

37
* [enhancement] Add DATE type conveter (thanks to @tksfjt1024)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ Column options are used to aid guessing BigQuery schema, or to define conversion
318318
- **fields**: Describes the nested schema fields if the type property is set to RECORD. Please note that this is **required** for `RECORD` column.
319319
- **timestamp_format**: timestamp format to convert into/from `timestamp` (string, default is `default_timestamp_format`)
320320
- **timezone**: timezone to convert into/from `timestamp`, `date` (string, default is `default_timezone`).
321+
- **description**: description for the column.
321322
- **default_timestamp_format**: default timestamp format for column_options (string, default is "%Y-%m-%d %H:%M:%S.%6N")
322323
- **default_timezone**: default timezone for column_options (string, default is "UTC")
323324

embulk-output-bigquery.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |spec|
22
spec.name = "embulk-output-bigquery"
3-
spec.version = "0.6.3"
3+
spec.version = "0.6.4"
44
spec.authors = ["Satoshi Akama", "Naotoshi Seo"]
55
spec.summary = "Google BigQuery output plugin for Embulk"
66
spec.description = "Embulk plugin that insert records to Google BigQuery."

lib/embulk/output/bigquery/helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def self.fields_from_embulk_schema(task, schema)
5050
field[:type] = (column_option['type'] || bq_type_from_embulk_type(embulk_type)).upcase
5151
field[:mode] = column_option['mode'] if column_option['mode']
5252
field[:fields] = deep_symbolize_keys(column_option['fields']) if column_option['fields']
53+
field[:description] = column_option['description'] if column_option['description']
5354
end
5455
end
5556
end

test/test_helper.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,25 @@ def test_fields_from_embulk_schema_with_column_options
7171
{'name' => 'boolean', 'type' => 'STRING', 'mode' => 'REQUIRED'},
7272
{'name' => 'long', 'type' => 'STRING'},
7373
{'name' => 'double', 'type' => 'STRING'},
74-
{'name' => 'string', 'type' => 'INTEGER'},
74+
{'name' => 'string', 'type' => 'INTEGER', 'description' => 'memo'},
7575
{'name' => 'timestamp', 'type' => 'INTEGER'},
7676
{'name' => 'date', 'type' => 'DATE'},
7777
{'name' => 'datetime', 'type' => 'DATETIME'},
7878
{'name' => 'json', 'type' => 'RECORD', 'fields' => [
79-
{ 'name' => 'key1', 'type' => 'STRING' },
79+
{ 'name' => 'key1', 'type' => 'STRING', 'description' => 'nested_memo'},
8080
]},
8181
],
8282
}
8383
expected = [
8484
{name: 'boolean', type: 'STRING', mode: 'REQUIRED'},
8585
{name: 'long', type: 'STRING'},
8686
{name: 'double', type: 'STRING'},
87-
{name: 'string', type: 'INTEGER'},
87+
{name: 'string', type: 'INTEGER', description: 'memo'},
8888
{name: 'timestamp', type: 'INTEGER'},
8989
{name: 'date', type: 'DATE'},
9090
{name: 'datetime', type: 'DATETIME'},
9191
{name: 'json', type: 'RECORD', fields: [
92-
{name: 'key1', type: 'STRING'},
92+
{name: 'key1', type: 'STRING', description: 'nested_memo'},
9393
]},
9494
]
9595
fields = Helper.fields_from_embulk_schema(task, schema)

0 commit comments

Comments
 (0)