Class: SparkConnect::Types::YearMonthIntervalType

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

Constant Summary collapse

YEAR =
0
MONTH =
1

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataType

#==, #hash, #inspect, #json, #json_value, #to_s

Constructor Details

#initialize(start_field = YEAR, end_field = MONTH) ⇒ YearMonthIntervalType

Returns a new instance of YearMonthIntervalType.



237
238
239
240
241
# File 'lib/spark_connect/types.rb', line 237

def initialize(start_field = YEAR, end_field = MONTH)
  super()
  @start_field = start_field
  @end_field = end_field
end

Instance Attribute Details

#end_fieldObject (readonly)

Returns the value of attribute end_field.



235
236
237
# File 'lib/spark_connect/types.rb', line 235

def end_field
  @end_field
end

#start_fieldObject (readonly)

Returns the value of attribute start_field.



235
236
237
# File 'lib/spark_connect/types.rb', line 235

def start_field
  @start_field
end

Instance Method Details

#simple_stringObject



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

def simple_string = "interval year to month"

#to_protoObject



246
247
248
# File 'lib/spark_connect/types.rb', line 246

def to_proto
  Types.wrap(year_month_interval: Proto::DataType::YearMonthInterval.new(start_field: start_field, end_field: end_field))
end

#type_nameObject



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

def type_name = "interval"