MCPcopy Create free account
hub / github.com/apache/impala / execute

Method execute

tests/common/impala_connection.py:678–699  ·  view source on GitHub ↗
(self, sql_stmt, user=None, fetch_profile_after_close=False,
              fetch_exec_summary=False, profile_format=TRuntimeProfileFormat.STRING)

Source from the content-addressed store, hash-verified

676 )
677
678 def execute(self, sql_stmt, user=None, fetch_profile_after_close=False,
679 fetch_exec_summary=False, profile_format=TRuntimeProfileFormat.STRING):
680 if user is None:
681 user = self.__user
682 same_user = (user == self.__user)
683 cursor = (self.default_cursor() if same_user
684 # Must create a new cursor to supply 'user'.
685 else self.__open_single_cursor(user=user))
686 result = None
687 try:
688 self.__log_execute(cursor, user, sql_stmt)
689 cursor.execute(sql_stmt, configuration=self.__query_options)
690 handle = OperationHandle(cursor, sql_stmt)
691 self.log_handle(handle, "query started")
692 result = self.__fetch_results_and_profile(
693 handle, fetch_profile_after_close=fetch_profile_after_close,
694 fetch_exec_summary=fetch_exec_summary, profile_format=profile_format)
695 finally:
696 cursor.close_operation()
697 if not same_user:
698 self.__close_single_cursor(cursor)
699 return result
700
701 def __fetch_results_and_profile(
702 self, operation_handle, fetch_profile_after_close=False,

Callers 1

Calls 8

default_cursorMethod · 0.95
__open_single_cursorMethod · 0.95
__log_executeMethod · 0.95
__close_single_cursorMethod · 0.95
OperationHandleClass · 0.85
executeMethod · 0.45
log_handleMethod · 0.45

Tested by

no test coverage detected