BigQuery API - Class Google::Cloud::Bigquery::Time (v1.46.1)

Reference documentation and code samples for the BigQuery API class Google::Cloud::Bigquery::Time.

Time

A TIME data type represents a time, independent of a specific date.

Inherits

  • Struct

Examples

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new

fourpm = Google::Cloud::Bigquery::Time.new "16:00:00"
data = bigquery.query "SELECT name " \
                      "FROM `my_project.my_dataset.my_table`" \
                      "WHERE time_of_date = @time",
                      params: { time: fourpm }

# Iterate over the first page of results
data.each do |row|
  puts row[:name]
end
# Retrieve the next page of results
data = data.next if data.next?

Create Time with fractional seconds:

require "google/cloud/bigquery"

bigquery = Google::Cloud::Bigquery.new

precise_time = Google::Cloud::Bigquery::Time.new "16:35:15.376541"
data = bigquery.query "SELECT name " \
                      "FROM `my_project.my_dataset.my_table`" \
                      "WHERE time_of_date >= @time",
                      params: { time: precise_time }

# Iterate over the first page of results
data.each do |row|
  puts row[:name]
end
# Retrieve the next page of results
data = data.next if data.next?

Methods

#value=

def value=(value) -> String

The BigQuery TIME.

Parameter
  • value (String) — the newly set value
Returns
  • (String) — the newly set value