Skip to content

SNOW-1916889: Expose richer query status (like the Python SDK) #1005

Open
@haggholm

Description

@haggholm

What is the current behavior?

A Snowflake Statement object has a getStatus() method, but currently, if the published types are correct, it only exposes two states:

export enum StatementStatus {
    Fetching = "fetching",
    Complete = "complete",
}

(I am assuming that the published types are correct, and these are indeed the only statuses I've observed. But if I'm wrong, I'd suggest that this ticket is still valid though as a request to improve the .d.ts types, docs, &c.)

What is the desired behavior?

The Python library (going by the API docs) exposes a much richer set of status constants, including RESUMING_WAREHOUSE and QUEUED, so I am assuming that the server interfaces already have access to more information. It would be nice if we could check for these through the Node connector.

It would be especially nice if the application could subscribe to push notifications rather than needing to poll, like

connection.execute({
  complete: (err) => { /* ... */ },
  onStatusChange: (newStatus, oldStatus) => { /* ... */ },
});

Simply allowing me to query for the other status options would be a huge help, though it would be nice to leave it to the driver to make sure no state transitions are missed by too-infrequent polling. (I'm particularly interested to know if a query leaves a waiting state like RESUMING_WAREHOUSE or QUEUED and enters an active state, to better measure duration of actual queries.)

How would this improve snowflake-connector-nodejs?

Currently it's often difficult to accurately diagnose performance problems, especially if operating as a SaaS platform without direct access to a customer's Snowflake environment and Snowsight UI. Is a query slow to complete because it's inefficient, because the customer's warehouse is backed up and the query is stuck in a queued state, because execution is slow, because result streaming is slow…? A fuller picture of query status would make it much easier to address performance problems.

References, Other Background

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementThe issue is a request for improvement or a new featurestatus-triage_doneInitial triage done, will be further handled by the driver team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions