Class: Fluent::BigQuery::DateTimeFieldSchema

Inherits:
FieldSchema
  • Object
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



184
185
186
187
188
189
190
# File 'lib/fluent/plugin/bigquery/schema.rb', line 184

def format_one(value, is_load: false)
  if value.respond_to?(:strftime)
    value.strftime("%Y-%m-%dT%H:%M:%S.%6L")
  else
    value
  end
end

#typeObject



180
181
182
# File 'lib/fluent/plugin/bigquery/schema.rb', line 180

def type
  :datetime
end