Class: SparkConnect::Types::CharType

Inherits:
DataType
  • Object
show all
Defined in:
lib/spark_connect/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataType

#hash, #inspect, #json, #to_s

Constructor Details

#initialize(length) ⇒ CharType

Returns a new instance of CharType.



182
183
184
185
# File 'lib/spark_connect/types.rb', line 182

def initialize(length)
  super()
  @length = length
end

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length.



180
181
182
# File 'lib/spark_connect/types.rb', line 180

def length
  @length
end

Instance Method Details

#==(other) ⇒ Object



192
# File 'lib/spark_connect/types.rb', line 192

def ==(other) = other.is_a?(CharType) && other.length == length

#json_valueObject



189
# File 'lib/spark_connect/types.rb', line 189

def json_value = "char(#{length})"

#simple_stringObject



187
# File 'lib/spark_connect/types.rb', line 187

def simple_string = "char(#{length})"

#to_protoObject



190
# File 'lib/spark_connect/types.rb', line 190

def to_proto = Types.wrap(char: Proto::DataType::Char.new(length: length))

#type_nameObject



188
# File 'lib/spark_connect/types.rb', line 188

def type_name = "char"