Interface QueryExecutionListener


public interface QueryExecutionListener
The interface of query execution listener that can be used to analyze execution metrics.

Note:
Implementations should guarantee thread-safety as they can be invoked by multiple different threads.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onFailure(String funcName, org.apache.spark.sql.execution.QueryExecution qe, Exception exception)
    A callback function that will be called when a query execution failed.
    void
    onSuccess(String funcName, org.apache.spark.sql.execution.QueryExecution qe, long durationNs)
    A callback function that will be called when a query executed successfully.
  • Method Details

    • onFailure

      void onFailure(String funcName, org.apache.spark.sql.execution.QueryExecution qe, Exception exception)
      A callback function that will be called when a query execution failed.

      Parameters:
      funcName - the name of the action that triggered this query.
      qe - the QueryExecution object that carries detail information like logical plan, physical plan, etc.
      exception - the exception that failed this query. If java.lang.Error is thrown during execution, it will be wrapped with an Exception and it can be accessed by exception.getCause.
      Note:
      This can be invoked by multiple different threads.
    • onSuccess

      void onSuccess(String funcName, org.apache.spark.sql.execution.QueryExecution qe, long durationNs)
      A callback function that will be called when a query executed successfully.

      Parameters:
      funcName - name of the action that triggered this query.
      qe - the QueryExecution object that carries detail information like logical plan, physical plan, etc.
      durationNs - the execution time for this query in nanoseconds.

      Note:
      This can be invoked by multiple different threads.