Class: RedshiftConnector::QueueryExporter
- Inherits:
-
Object
- Object
- RedshiftConnector::QueueryExporter
- Defined in:
- lib/redshift_connector/queuery_exporter.rb
Instance Attribute Summary collapse
-
#bundle ⇒ Object
readonly
Returns the value of attribute bundle.
-
#bundle_params ⇒ Object
readonly
Returns the value of attribute bundle_params.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(ds:, query:, bundle_params: nil, enable_sort: false, logger: RedshiftConnector.logger) ⇒ QueueryExporter
constructor
A new instance of QueueryExporter.
Constructor Details
#initialize(ds:, query:, bundle_params: nil, enable_sort: false, logger: RedshiftConnector.logger) ⇒ QueueryExporter
5 6 7 8 9 10 11 12 |
# File 'lib/redshift_connector/queuery_exporter.rb', line 5 def initialize(ds:, query:, bundle_params: nil, enable_sort: false, logger: RedshiftConnector.logger) @ds = ds @query = query @bundle_params = bundle_params @bundle = nil @enable_sort = enable_sort @logger = logger end |
Instance Attribute Details
#bundle ⇒ Object (readonly)
Returns the value of attribute bundle.
16 17 18 |
# File 'lib/redshift_connector/queuery_exporter.rb', line 16 def bundle @bundle end |
#bundle_params ⇒ Object (readonly)
Returns the value of attribute bundle_params.
15 16 17 |
# File 'lib/redshift_connector/queuery_exporter.rb', line 15 def bundle_params @bundle_params end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
17 18 19 |
# File 'lib/redshift_connector/queuery_exporter.rb', line 17 def logger @logger end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
14 15 16 |
# File 'lib/redshift_connector/queuery_exporter.rb', line 14 def query @query end |
Instance Method Details
#execute ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/redshift_connector/queuery_exporter.rb', line 19 def execute @logger.info "EXPORT #{@query.description} -> (Queuery S3 tmp)" stmt = @query.to_sql @logger.info "[SQL/Queuery] #{stmt.strip}" # FIXME: support enable_sort # FIXME: pass bundle_params? @bundle = @ds.execute_query(stmt) @bundle end |