Class: SparkConnect::Types::MapType
- Defined in:
- lib/spark_connect/types.rb
Overview
A map type with key and value element types.
Instance Attribute Summary collapse
-
#key_type ⇒ Object
readonly
Returns the value of attribute key_type.
-
#value_contains_null ⇒ Object
readonly
Returns the value of attribute value_contains_null.
-
#value_type ⇒ Object
readonly
Returns the value of attribute value_type.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(key_type, value_type, value_contains_null: true) ⇒ MapType
constructor
A new instance of MapType.
- #json_value ⇒ Object
- #simple_string ⇒ Object
- #to_proto ⇒ Object
- #type_name ⇒ Object
Methods inherited from DataType
Constructor Details
#initialize(key_type, value_type, value_contains_null: true) ⇒ MapType
Returns a new instance of MapType.
288 289 290 291 292 293 |
# File 'lib/spark_connect/types.rb', line 288 def initialize(key_type, value_type, value_contains_null: true) super() @key_type = key_type @value_type = value_type @value_contains_null = value_contains_null end |
Instance Attribute Details
#key_type ⇒ Object (readonly)
Returns the value of attribute key_type.
286 287 288 |
# File 'lib/spark_connect/types.rb', line 286 def key_type @key_type end |
#value_contains_null ⇒ Object (readonly)
Returns the value of attribute value_contains_null.
286 287 288 |
# File 'lib/spark_connect/types.rb', line 286 def value_contains_null @value_contains_null end |
#value_type ⇒ Object (readonly)
Returns the value of attribute value_type.
286 287 288 |
# File 'lib/spark_connect/types.rb', line 286 def value_type @value_type end |
Instance Method Details
#==(other) ⇒ Object
315 316 317 318 |
# File 'lib/spark_connect/types.rb', line 315 def ==(other) other.is_a?(MapType) && other.key_type == key_type && other.value_type == value_type && other.value_contains_null == value_contains_null end |
#json_value ⇒ Object
298 299 300 301 302 303 304 305 |
# File 'lib/spark_connect/types.rb', line 298 def json_value { "type" => "map", "keyType" => key_type.json_value, "valueType" => value_type.json_value, "valueContainsNull" => value_contains_null, } end |
#simple_string ⇒ Object
295 |
# File 'lib/spark_connect/types.rb', line 295 def simple_string = "map<#{key_type.simple_string},#{value_type.simple_string}>" |
#to_proto ⇒ Object
307 308 309 310 311 312 313 |
# File 'lib/spark_connect/types.rb', line 307 def to_proto Types.wrap(map: Proto::DataType::Map.new( key_type: key_type.to_proto, value_type: value_type.to_proto, value_contains_null: value_contains_null )) end |
#type_name ⇒ Object
296 |
# File 'lib/spark_connect/types.rb', line 296 def type_name = "map" |