def open
      return if @connected

      socket = Thrift::Socket.new(@host, @port, @options[:timeout])

      if @options[:kerberos]
        @transport = SASLTransport.new(socket, :GSSAPI, @options[:kerberos])
      elsif @options[:sasl]
        @transport = SASLTransport.new(socket, :PLAIN, @options[:sasl])
      else
        @transport = Thrift::BufferedTransport.new(socket)
      end

      @transport.open

      proto = Thrift::BinaryProtocol.new(@transport)
      @service = Protocol::ImpalaService::Client.new(proto)
      @connected = true
    end
def open
      return if @connected

      socket = Thrift::Socket.new(@host, @port, @options[:timeout])

      if @options[:kerberos]
        @transport = SASLTransport.new(socket, :GSSAPI, @options[:kerberos])
      elsif @options[:sasl]
        @transport = SASLTransport.new(socket, :PLAIN, @options[:sasl])
      else
        @transport = Thrift::BufferedTransport.new(socket)
      end

      @transport.open

      proto = Thrift::BinaryProtocol.new(@transport)
      @service = Protocol::ImpalaService::Client.new(proto)
      @connected = true
    end
Open the connection if it's currently closed.