Skip to content

Commit f8d91a4

Browse files
jimktrainsJon Wayne Parrott
authored and
Jon Wayne Parrott
committed
Adds option to set the file format for export jobs (#405)
1 parent a1f2903 commit f8d91a4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bigquery/api/export_data_to_cloud_storage.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ def main(cloud_storage_path, project_id, dataset_id, table_id,
154154
help='compress resultset with gzip',
155155
action='store_true',
156156
default=False)
157+
parser.add_argument(
158+
'-f', '--format',
159+
help='output file format',
160+
choices=['CSV', 'NEWLINE_DELIMITED_JSON', 'AVRO'],
161+
default='CSV')
157162

158163
args = parser.parse_args()
159164

@@ -164,5 +169,6 @@ def main(cloud_storage_path, project_id, dataset_id, table_id,
164169
args.table_id,
165170
args.num_retries,
166171
args.poll_interval,
172+
export_format=args.format,
167173
compression="GZIP" if args.gzip else "NONE")
168174
# [END main]

0 commit comments

Comments
 (0)