Browse Source

Strip trailing semicolon for Apache Drill

Andrew Kane 7 years ago
parent
commit
1fe79eca57
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lib/blazer/adapters/drill_adapter.rb

+ 2 - 1
lib/blazer/adapters/drill_adapter.rb

@@ -8,7 +8,8 @@ module Blazer
 
 
         drill = ::Drill.new(url: settings["url"])
         drill = ::Drill.new(url: settings["url"])
         begin
         begin
-          response = drill.query(statement)
+          # remove trailing semicolon
+          response = drill.query(statement.sub(/;\s*\z/, ""))
           rows = response.map { |r| r.values }
           rows = response.map { |r| r.values }
           columns = rows.any? ? response.first.keys : []
           columns = rows.any? ? response.first.keys : []
         rescue => e
         rescue => e