Sha256: 3d96f18ed47882f1e45a8f2b3b90121ce3fcd7f4213bc30d6efe899b77fd57cc

Contents?: true

Size: 1.91 KB

Versions: 1

Compression:

Stored size: 1.91 KB

Contents

# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


module Google
  module Cloud
    module Bigquery
      ##
      # # Time
      #
      # A TIME data type represents a time, independent of a specific date.
      #
      # @attr_writer [String] value The BigQuery TIME.
      #
      # @example
      #   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_proj.my_data.my_table`" \
      #                         "WHERE time_of_date = @time",
      #                         params: { time: fourpm }
      #
      #   data.each do |row|
      #     puts row["name"]
      #   end
      #
      # @example 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_proj.my_data.my_table`" \
      #                         "WHERE time_of_date >= @time",
      #                         params: { time: precise_time }
      #
      #   data.each do |row|
      #     puts row["name"]
      #   end
      #
      Time = Struct.new :value
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
google-cloud-bigquery-0.24.0 lib/google/cloud/bigquery/time.rb