Class: Sequel::Platform::Spark

Inherits:
Base
  • Object
show all
Defined in:
lib/sequel/extensions/platform.rb

Overview

Spark platform with Spark SQL-specific function translations.

Instance Attribute Summary

Attributes inherited from Base

#config, #db

Instance Method Summary collapse

Methods inherited from Base

#[], #cast_date, #days_between, #fetch, #initialize, #prefers?, #supports?

Constructor Details

This class inherits a constructor from Sequel::Platform::Base

Instance Method Details

#date_diff(from, to) ⇒ Object



146
147
148
149
# File 'lib/sequel/extensions/platform.rb', line 146

def date_diff(from, to)
  # Spark datediff has reversed argument order (end, start)
  Sequel.function(:datediff, to, from)
end

#str_to_date(value, format) ⇒ Object



151
152
153
# File 'lib/sequel/extensions/platform.rb', line 151

def str_to_date(value, format)
  Sequel.function(:to_date, Sequel.cast_string(value), format)
end