浏览代码

Strip trailing semicolon for Apache Drill

Andrew Kane 7 年之前
父节点
当前提交
1fe79eca57
共有 1 个文件被更改,包括 2 次插入1 次删除
  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