Module: ElasticGraph::Warehouse::SchemaDefinition::ObjectAndInterfaceExtension
- Defined in:
- elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/object_and_interface_extension.rb
Overview
Extends SchemaDefinition::SchemaElements::ObjectType and SchemaDefinition::SchemaElements::InterfaceType to add warehouse column type conversion.
Instance Method Summary collapse
-
#to_warehouse_column_type ⇒ String
Returns the warehouse column type representation for this object or interface type.
Instance Method Details
#to_warehouse_column_type ⇒ String
Returns the warehouse column type representation for this object or interface type.
20 21 22 23 24 25 26 27 28 29 |
# File 'elasticgraph-warehouse/lib/elastic_graph/warehouse/schema_definition/object_and_interface_extension.rb', line 20 def to_warehouse_column_type subfields = indexing_fields_by_name_in_index.values.map(&:to_indexing_field).compact struct_field_expressions = subfields.map do |subfield| warehouse_type = FieldTypeConverter.convert(subfield.type) "#{subfield.name} #{warehouse_type}" end.join(", ") "STRUCT<#{struct_field_expressions}>" end |