You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are facing an issue with the Vertica library when a row_handler is passed to query execution.
Scenario :
Query1: select * from persons limit 0;
This is expected to return the column metadata info w.r.t person table but returns an empty string and as there is no result it doesn't execute the code block.
result_rows = []
column_names = []
query_result =
connection.query(execution.query) do |result|
result_rows.push(result)
column_names = result.row_description.as_json if column_names.empty?
end
As a workaround we are overriding the Vertica::Query#handle command complete method to return the metadata info.
To make an Unbuffered Query
class Vertica::Query
private
def handle_command_complete(message)
if buffer_rows?
@result = Vertica::Result.new(row_description: @row_description, rows: @buffer, tag: message.tag)
@row_description = nil
@buffer = nil
else
@result = Vertica::Result.new(row_description: @row_description, rows: [], tag: message.tag)
end
end
end
Hey Team,
We are facing an issue with the Vertica library when a row_handler is passed to query execution.
Scenario :
Query1:
select * from persons limit 0;
This is expected to return the column metadata info w.r.t person table but returns an empty string and as there is no result it doesn't execute the code block.
As a workaround we are overriding the Vertica::Query#handle command complete method to return the metadata info.
To make an Unbuffered Query
Refer Issues with Previous Version: #69
The text was updated successfully, but these errors were encountered: