Query

Dataclass Query represents information about query returned by Snowflake REST API.

  • query_id (str) - UUID of query

  • query_tag (str)

  • sql_text (str)

  • status (str) - RUNNING, BLOCKED, QUEUED, etc.

  • state (str) - internal state of query, provides more in-depth information compared to status

  • session (Session) - information about query session, obtained from REST API

    • session_id (str)

    • client_application (str)

    • client_environment (Dict[str, Any]) - parsed JSON with of environment vars

    • client_net_address (IPv4Address)

    • client_support_info (str)

    • user_name (str)

  • user (User) - information about user trying to execute query, obtained from SHOW USERS

    • name (str)

    • login_name (str)

    • display_name (str)

    • email (str)

    • comment (str)

    • default_warehouse (str)

    • default_role (str)

    • owner (str)

  • client_send_time (datetime) - when client submitted query to Snowflake blackend

  • start_time (datetime) - when query actually started execution

  • end_time (datetime) - when query finished execution, None for queries which did not finish yet

  • compile_duration (float) - how long did it take to compile query, in seconds

  • execute_duration (float) - how long did it take to execute query so far, in seconds

  • queued_duration (float) - how long did query spent in queue so far, in seconds

  • listing_external_file_duration (float) - how long did it take to list external files, in seconds

  • total_duration (float) - how long did all query steps take so far, in seconds

  • warehouse_id (int)

  • warehouse_name (str)

  • warehouse_external_size (str)

  • warehouse_server_type (str)

  • stats (Dict[str, Any]) - additional internal statistics returned by REST API

  • meta_version (int) - version of REST API response

  • snowflake_version (tuple) - version of Snowflake backend

Last updated