Skip to content

Adds option to set the file format for export jobs #405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bigquery/api/export_data_to_cloud_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ def main(cloud_storage_path, project_id, dataset_id, table_id,
help='compress resultset with gzip',
action='store_true',
default=False)
parser.add_argument(
'-f', '--format',
help='output file format',
choices=['CSV', 'NEWLINE_DELIMITED_JSON', 'AVRO'],
default='CSV')

args = parser.parse_args()

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