google-code-export / google-bigquery

Automatically exported from code.google.com/p/google-bigquery
1 stars 0 forks source link

My Chinese characters in query results cannot show right #200

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the product are you using? On what operating system?

Bigquery in Chrome 39.0.2171.62 dev-m on Windows 8.1

Please provide any additional information below.

As shown in the attached picture, all Chinese characters are not shown as 
expected.

Who can help me on the character issue.

Original issue reported on code.google.com by gongming...@gmail.com on 17 Dec 2014 at 8:52

Attachments:

GoogleCodeExporter commented 9 years ago
Solved!

I re-encode the previous csv file with UTF-8 character format, then everything 
OK

Original comment by gongming...@gmail.com on 17 Dec 2014 at 9:12

GoogleCodeExporter commented 9 years ago
But for the schema, I still cannot use Chinese characters for the name.

Original comment by gongming...@gmail.com on 17 Dec 2014 at 9:19

GoogleCodeExporter commented 9 years ago
I'm glad you were able to find a solution!  BigQuery uses UTF-8 for data 
storage, as you have found.

I am afraid we will likely not support UTF-8 for column names, at least not 
anytime soon.

Original comment by thomasp...@google.com on 17 Dec 2014 at 5:44

GoogleCodeExporter commented 9 years ago
If you'd like to associate Chinese characters with fields in your schema, I'd 
suggest adding a field description for the fields in question.

Original comment by dk...@google.com on 17 Dec 2014 at 5:51

GoogleCodeExporter commented 9 years ago
Thanks both.

Then what the table schema format will be if I would like to add field 
description for all my fields, and how I can use the field description in the 
query?

Thanks in advance.

Original comment by gongming...@gmail.com on 18 Dec 2014 at 7:07

GoogleCodeExporter commented 9 years ago
Unfortunately, field descriptions cannot be used to reference the fields.

However, if you want to add descriptions to your fields, you can do this by 
specifying a description in the schema when you create a table:

https://cloud.google.com/bigquery/docs/reference/v2/tables#schema.fields.descrip
tion

e.g., if before you passed a field

{"name": "foo", "type": "string", "mode": "nullable"}

you could instead pass

{"name": "foo", "type": "string", "mode": "nullable", description: "<insert 
description>"}

You could also update the schemas of existing tables to include these 
descriptions, which can be done from the table's page in our web UI (click on 
"Describe this field..." and enter a description), or via our API or CLI using 
the update command on the table.

Original comment by dk...@google.com on 19 Dec 2014 at 8:52