Class: Fluent::BigQuery::DateFieldSchema

Inherits:
FieldSchema show all
Defined in:
lib/fluent/plugin/bigquery/schema.rb

Instance Attribute Summary

Attributes inherited from FieldSchema

#mode, #name

Instance Method Summary collapse

Methods inherited from FieldSchema

#format, #initialize, #to_h

Constructor Details

This class inherits a constructor from Fluent::BigQuery::FieldSchema

Instance Method Details

#format_one(value, is_load: false) ⇒ Object



170
171
172
173
174
175
176
# File 'lib/fluent/plugin/bigquery/schema.rb', line 170

def format_one(value, is_load: false)
  if value.respond_to?(:strftime)
    value.strftime("%Y-%m-%d")
  else
    value
  end
end

#typeObject



166
167
168
# File 'lib/fluent/plugin/bigquery/schema.rb', line 166

def type
  :date
end