Parcourir la source

Strip trailing semicolon for Apache Drill

Andrew Kane il y a 7 ans
Parent
commit
1fe79eca57
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  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"])
         begin
-          response = drill.query(statement)
+          # remove trailing semicolon
+          response = drill.query(statement.sub(/;\s*\z/, ""))
           rows = response.map { |r| r.values }
           columns = rows.any? ? response.first.keys : []
         rescue => e