Module: Sequel::Unionize
- Defined in:
- lib/sequel/extensions/unionize.rb
Overview
Provides efficient handling of large UNION operations.
The unionize extension allows combining many datasets through UNION operations by chunking them into manageable temporary tables or views. This is particularly useful when dealing with databases that have limitations on the number of UNION operations in a single query (e.g., Spark SQL, DuckDB).
Defined Under Namespace
Classes: Unionizer
Instance Method Summary collapse
-
#unionize(ds_set, opts = {}) ⇒ Sequel::Dataset
Efficiently combines multiple datasets using UNION operations.
Instance Method Details
#unionize(ds_set, opts = {}) ⇒ Sequel::Dataset
Efficiently combines multiple datasets using UNION operations.
This method handles large numbers of datasets by chunking them into manageable groups, creating temporary tables/views for intermediate results, and recursively combining them until a single dataset is produced.
161 162 163 |
# File 'lib/sequel/extensions/unionize.rb', line 161 def unionize(ds_set, opts = {}) Unionizer.new(self, ds_set, opts).unionize end |