Skip to content
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

bigquery how extract to csv with UTF-8 with BOM #292

Closed
albertog opened this issue Jul 20, 2016 · 9 comments
Closed

bigquery how extract to csv with UTF-8 with BOM #292

albertog opened this issue Jul 20, 2016 · 9 comments
Assignees
Labels
api: bigquery Issues related to the BigQuery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@albertog
Copy link

albertog commented Jul 20, 2016

Will be very very interesting add posibility to add BOM byte sequence to file extracted from bigquery in order to be reader properly with excel. Now the csv exported work ok but manually you need to choose utf-8.

Similarity you can choose a custom delimiter will be nice that we can choice encoding w/o BOM and emit a csv compatible with excel. thanks

probably 80% of bigquery csv output will be reader by ms excel.

see:
http://stackoverflow.com/questions/2223882/whats-different-between-utf-8-and-utf-8-without-bom

@bradfitz
Copy link
Contributor

/cc @robpike

@robpike
Copy link

robpike commented Jul 21, 2016

Are you saying that Excel only works with UTF-8 if there is a leading BOM? That is rebarbative.

@jba
Copy link
Contributor

jba commented Jul 21, 2016

Alberto, I don't think we will change BigQuery to implement something that is not recommended. But it should be easy to do this yourself: once you download the csv, just prepend the three BOM bytes to the file.

@albertog
Copy link
Author

No @robpike I am saying that if your extract a bigquery csv file and open directly from Excel character as "ñ, º, € , ü, etc " appear strange and end user "not programer" think that underling data is erroneous and create a bad experience and issue. If you manually import selecting a right encoding utf-8 work propertly but end user must be explicitly select a type of encoding something that not every end user know.

@jba I understand but the fact is that excel use this encoding and it a standard in windows office environment currently so we are requesting a option and of course a feature of api not a default behaviour to improve end user experience I assume you can post-process the file but you need add logic, spent resources, complexity and time.

Thanks for answer me.

@jba jba added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: bigquery Issues related to the BigQuery API. labels Jul 22, 2016
@okdave
Copy link
Contributor

okdave commented Jul 26, 2016

@albertog I don't think this is a feasible request for this client library since the actual creation of the CSV file happens in the BigQuery service itself, and the Go code doesn't get to influence how it's made. I'd suggest opening a feature request on the google-bigquery issue tracker. I don't know if they would want to support a non-standard CSV encoding, but maybe there would be an option to support an Excel-specific output.

If you're using the google.golang.org/cloud/storage library to actually download the extracted CSV onto the local machine, then it should be simple to prepend the three bytes yourself, or to re-encode the file from UTF-8 into the machine's default encoding (which, I understand, varies between windows installations).

@okdave okdave closed this as completed Jul 26, 2016
@albertog
Copy link
Author

okdave it make sense. I will do it

@marcosdiez
Copy link

Currently it's not possible to do it. There is a bug request for it on Google. If you are affected by this issue, please go there and star it: https://issuetracker.google.com/issues/35905733

@nosovk
Copy link

nosovk commented Feb 2, 2019

Is it possible to start first column name with BOM character?

@jeanbza
Copy link
Member

jeanbza commented Feb 2, 2019

@nosovk This thread is dead. Do you mind opening a new issue?

jeanbza pushed a commit to jeanbza/google-cloud-go that referenced this issue Mar 29, 2019
Fixes googleapis#292

Change-Id: I2b3bd5eaa4e4577e0cb18d23f819ca3a0540afce
Reviewed-on: https://code-review.googlesource.com/33210
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

8 participants