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.
415 416 417 |
# File 'lib/fluent/plugin/out_groonga.rb', line 415 def initialize(sample_values) @sample_values = sample_values end |
Instance Method Details
#guess ⇒ Object
419 420 421 422 423 424 425 426 427 428 429 430 |
# File 'lib/fluent/plugin/out_groonga.rb', line 419 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
432 433 434 435 436 |
# File 'lib/fluent/plugin/out_groonga.rb', line 432 def vector? @sample_values.any? do |sample_value| sample_value.is_a?(Array) end end |