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

Switch returned data to use symbols #1314

Merged
merged 1 commit into from
Mar 3, 2017

Conversation

blowmage
Copy link
Contributor

@blowmage blowmage commented Mar 3, 2017

This changes the hash key values in the rows of data returned from BigQuery. This change brings BigQuery in line with Spanner.

Before the hash keys were strings:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
db = bigquery.dataset "mine"

db.query "SELECT * FROM stuff"
rows == [{"name"=>"mike", "foo"=>[{"bar"=>"hey", "baz"=>{"bif"=>1}}, {"bar"=>"world", "baz"=>{"bif"=>2}}]}] #=> true

Now the hash keys are symbols:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new
db = bigquery.dataset "mine"

db.query "SELECT * FROM stuff"
rows == [{ name: "mike", foo: [{ bar: "hey", baz: { bif: 1 } }, { bar: "world", baz: { bif: 2 } }] }] #=> true

@blowmage blowmage added api: bigquery Issues related to the BigQuery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Mar 3, 2017
@blowmage blowmage self-assigned this Mar 3, 2017
@blowmage blowmage requested a review from landrito March 3, 2017 00:45
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 3, 2017
Each row of data is represented as a Hash.
Change the row to use symbols for keys in the hash.
This change brings BigQuery in line with Spanner.

Update Table#headers, View#headers, and QueryData#headers to
also return symbols instead of strings.
@blowmage blowmage merged commit 41cfacc into googleapis:master Mar 3, 2017
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. cla: yes This human has signed the Contributor License Agreement. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants