Class: Blazer::Adapters::DrillAdapter
Instance Attribute Summary
Attributes inherited from BaseAdapter
#data_source
Instance Method Summary
collapse
Methods inherited from BaseAdapter
#cachable?, #cancel, #cohort_analysis_statement, #cost, #explain, #initialize, #preview_statement, #reconnect, #schema, #supports_cohort_analysis?, #tables
Instance Method Details
#parameter_binding ⇒ Object
27
28
29
|
# File 'lib/blazer/adapters/drill_adapter.rb', line 27
def parameter_binding
end
|
#quoting ⇒ Object
22
23
24
|
# File 'lib/blazer/adapters/drill_adapter.rb', line 22
def quoting
:single_quote_escape
end
|
#run_statement(statement, comment) ⇒ Object
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/blazer/adapters/drill_adapter.rb', line 4
def run_statement(statement, )
columns = []
rows = []
error = nil
begin
response = drill.query(statement.sub(/;\s*\z/, ""))
rows = response.map { |r| r.values }
columns = rows.any? ? response.first.keys : []
rescue => e
error = e.message
end
[columns, rows, error]
end
|