# google-cloud-bigquery [Google BigQuery](https://cloud.google.com/bigquery/) ([docs](https://cloud.google.com/bigquery/docs)) enables super-fast, SQL-like queries against append-only tables, using the processing power of Google's infrastructure. Simply move your data into BigQuery and let it handle the hard work. You can control access to both the project and your data based on your business needs, such as giving others the ability to view or query your data. - [google-cloud-bigquery API documentation](http://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-bigquery/latest) - [google-cloud-bigquery on RubyGems](https://rubygems.org/gems/google-cloud-bigquery) - [Google BigQuery documentation](https://cloud.google.com/bigquery/docs) ## Quick Start ```sh $ gem install google-cloud-bigquery ``` ## Authentication This library uses Service Account credentials to connect to Google Cloud services. When running on Compute Engine the credentials will be discovered automatically. When running on other environments the Service Account credentials can be specified by providing the path to the JSON file, or the JSON itself, in environment variables. Instructions and configuration options are covered in the [Authentication Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-bigquery/guides/authentication). ## Example ```ruby require "google/cloud/bigquery" bigquery = Google::Cloud::Bigquery.new( project: "my-todo-project", keyfile: "/path/to/keyfile.json" ) # Create a new table to archive todos dataset = bigquery.dataset "my-todo-archive" table = dataset.create_table "todos", name: "Todos Archive", description: "Archive for completed TODO records" # Load data into the table file = File.open "/archive/todos/completed-todos.csv" load_job = table.load file # Run a query for the number of completed todos by owner count_sql = "SELECT owner, COUNT(*) AS complete_count FROM todos GROUP BY owner" data = bigquery.query count_sql data.each do |row| puts row[:name] end ``` ## Supported Ruby Versions This library is supported on Ruby 2.0+. ## Versioning This library follows [Semantic Versioning](http://semver.org/). It is currently in major version zero (0.y.z), which means that anything may change at any time and the public API should not be considered stable. ## Contributing Contributions to this library are always welcome and highly encouraged. See the [Contributing Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/guides/contributing) for more information on how to get started. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct](../CODE_OF_CONDUCT.md) for more information. ## License This library is licensed under Apache 2.0. Full license text is available in [LICENSE](LICENSE). ## Support Please [report bugs at the project on Github](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues). Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).