Class: Fluent::Plugin::GroongaOutput::Schema::TypeGuesser
- Inherits:
-
Object
- Object
- Fluent::Plugin::GroongaOutput::Schema::TypeGuesser
- Defined in:
- lib/fluent/plugin/out_groonga.rb
Instance Method Summary collapse
- #guess ⇒ Object
-
#initialize(sample_values) ⇒ TypeGuesser
constructor
A new instance of TypeGuesser.
- #vector? ⇒ Boolean
Constructor Details
#initialize(sample_values) ⇒ TypeGuesser
Returns a new instance of TypeGuesser.
414 415 416 |
# File 'lib/fluent/plugin/out_groonga.rb', line 414 def initialize(sample_values) @sample_values = sample_values end |
Instance Method Details
#guess ⇒ Object
418 419 420 421 422 423 424 425 426 427 428 429 |
# File 'lib/fluent/plugin/out_groonga.rb', line 418 def guess return "Bool" if bool_values? return "Time" if time_values? return "Int32" if int32_values? return "Int64" if int64_values? return "Float" if float_values? return "WGS84GeoPoint" if geo_point_values? return "LongText" if long_text_values? return "Text" if text_values? "ShortText" end |
#vector? ⇒ Boolean
431 432 433 434 435 |
# File 'lib/fluent/plugin/out_groonga.rb', line 431 def vector? @sample_values.any? do |sample_value| sample_value.is_a?(Array) end end |