Class: SparkConnect::Types::VarcharType

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) ⇒ VarcharType

Returns a new instance of VarcharType.



198
199
200
201
# File 'lib/spark_connect/types.rb', line 198

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

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length.



196
197
198
# File 'lib/spark_connect/types.rb', line 196

def length
  @length
end

Instance Method Details

#==(other) ⇒ Object



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

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

#json_valueObject



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

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

#simple_stringObject



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

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

#to_protoObject



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

def to_proto = Types.wrap(var_char: Proto::DataType::VarChar.new(length: length))

#type_nameObject



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

def type_name = "varchar"