Module: DWH::Functions::Arrays
- Included in:
- DWH::Functions
- Defined in:
- lib/dwh/functions/arrays.rb
Overview
Operations on array columns. Mostly used in where clauses
Instance Method Summary collapse
-
#array_exclude_list(exp, list) ⇒ Object
Generates sql test to see if any values from the passed in list is NOT in the array column/exp.
-
#array_in_list(exp, list) ⇒ Object
Generates sql test to see if any values from the passed in list is in the array column/exp.
-
#array_unnest_join(exp, table_alias) ⇒ Object
Explode an array.
Instance Method Details
#array_exclude_list(exp, list) ⇒ Object
Generates sql test to see if any values from the passed in list is NOT in the array column/exp.
23 24 25 26 27 |
# File 'lib/dwh/functions/arrays.rb', line 23 def array_exclude_list(exp, list) raise UnsupportedCapability unless supports_array_functions? gsk(:array_exclude_list).gsub(/@exp/i, exp).gsub(/@list/i, list) end |
#array_in_list(exp, list) ⇒ Object
Generates sql test to see if any values from the passed in list is in the array column/exp.
11 12 13 14 15 |
# File 'lib/dwh/functions/arrays.rb', line 11 def array_in_list(exp, list) raise UnsupportedCapability unless supports_array_functions? gsk(:array_in_list).gsub(/@exp/i, exp).gsub(/@list/i, list) end |
#array_unnest_join(exp, table_alias) ⇒ Object
Explode an array. This should be used in a join expression.
33 34 35 36 37 38 39 |
# File 'lib/dwh/functions/arrays.rb', line 33 def array_unnest_join(exp, table_alias) raise UnsupportedCapability unless supports_array_functions? gsk(:array_unnest_join) .gsub(/@exp/i, exp) .gsub(/@alias/i, table_alias) end |