Class: Fluent::GroongaOutput::Schema::TypeGuesser
- Inherits:
-
Object
- Object
- Fluent::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.
377 378 379 |
# File 'lib/fluent/plugin/out_groonga.rb', line 377 def initialize(sample_values) @sample_values = sample_values end |
Instance Method Details
#guess ⇒ Object
381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/fluent/plugin/out_groonga.rb', line 381 def guess 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
393 394 395 396 397 |
# File 'lib/fluent/plugin/out_groonga.rb', line 393 def vector? @sample_values.any? do |sample_value| sample_value.is_a?(Array) end end |