class_docstr: This handler handles connection and execution of the Impala statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","Impala","statements","."]
code: def check_connection(self) -> StatusResponse:
      result = StatusResponse(False)
      need_to_close = self.is_connected is False
  
      try:
          connection = self.connect()
          result.success = connection is not None
      except Exception as e:
          logger.error(
              f'x x x Error connecting to Impala {self.connection_data["database"]}, {e}!'
          )
          result.error_message = str(e)
  
      if result.success is True and need_to_close:
          self.disconnect()
      if result.success is False and self.is_connected is True:
          self.is_connected = False
  
      return result
  
imports: from collections import OrderedDict
  from typing import Optional
  import pandas
  from impala import dbapi, sqlalchemy
  from mindsdb_sql import parse_sql
  from mindsdb_sql.render.sqlalchemy_render import SqlalchemyRender
  from mindsdb_sql.parser.ast.base import ASTNode
  from mindsdb.utilities import log
  from mindsdb.integrations.libs.base import DatabaseHandler
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse, RESPONSE_TYPE
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
label_desc: Use image node_id 4 for calling the ImpalaHandler obj's underlying member method code with example usage: obj.check_connection() and returns: result