Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-950923: SnowflakeDbCommand.GetQueryId() returns null on PUT cmd #802

Closed
sfc-gh-agoldberg opened this issue Oct 25, 2023 · 10 comments
Closed
Assignees
Labels
bug status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector.

Comments

@sfc-gh-agoldberg
Copy link

When I Execute a PUT command and then use GetQueryId on the command object which executed - it returns null.
I haven't seen this with any other command.

Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

  1. What version of .NET driver are you using?
    2.1.2

  2. What operating system and processor architecture are you using?
    Tested on Mac (M2) and PC (Win11/x64)

  3. What version of .NET framework are you using?
    netcore 7.0.12

  4. What did you do?

SnowflakeDbCommand command = new SnowflakeDbCommand(_connection, "PUT file://path/to/file.csv @stage_name");
System.Data.Common.DbDataReader reader = command.ExecuteReader() ;
string queryId = command.GetQueryId(); // this returns null

  1. What did you expect to see?
    I expect a valid query Id

  2. Can you set logging to DEBUG and collect the logs?
    let me know if this is needed - can try later.

  3. What is your Snowflake account identifier, if any? (Optional)

@github-actions github-actions bot changed the title SnowflakeDbCommand.GetQueryId() returns null on PUT cmd SNOW-950923: SnowflakeDbCommand.GetQueryId() returns null on PUT cmd Oct 25, 2023
@sfc-gh-dszmolka sfc-gh-dszmolka self-assigned this Oct 27, 2023
@sfc-gh-dszmolka
Copy link
Contributor

hi and thank you for raising this issue - also appreciate the code snippet ! reproduced the same issue with the latest (2.1.2 at the time of writing) version of the driver; also observed that GET command is similarly affected, not only PUT.

We'll take a look.

@sfc-gh-dszmolka sfc-gh-dszmolka added the status-in_progress Issue is worked on by the driver team label Oct 27, 2023
@sfc-gh-dszmolka
Copy link
Contributor

this is still under investigation and thank you for bearing with us while this gets sorted ! for the 'PUT command failed' scenario, it will require a bit bigger effort, but for the 'PUT command was successful' scenario, you might be able to get the queryid for the PUT (or GET) command with something like

using (var command = connection.CreateCommmand())
{
   command.CommandText = "PUT file:///path/to/file.txt @mystage";
   var reader = command.ExecuteReader();
   // the above is generic DbReader
   // but if we convert it to the actual type we can access QueryID 
   // for succeeded operations
   var queryId = ((SnowflakeDbDataReader)reader).GetQueryId();
..

@sfc-gh-mhofman
Copy link
Collaborator

It will be available on the command level as well

@sfc-gh-dszmolka
Copy link
Contributor

PR is #825

@sfc-gh-dszmolka sfc-gh-dszmolka added status-pr_pending_merge A PR is made and is under review and removed status-in_progress Issue is worked on by the driver team labels Nov 30, 2023
@sfc-gh-mhofman
Copy link
Collaborator

@sfc-gh-dszmolka Code is ready however it introduces a BCR and will get released along with other bigger breaking changes in Q1.

@sfc-gh-dszmolka
Copy link
Contributor

hey @sfc-gh-mhofman thanks for the heads-up, this is great news! Do we have any estimation when this could be; together with the regular driver release cycle in February or some other time?

@sfc-gh-mhofman
Copy link
Collaborator

@sfc-gh-dszmolka worse case March release cc @sfc-gh-knozderko

@sfc-gh-mhofman
Copy link
Collaborator

@sfc-gh-dszmolka planned for the Feb release

@sfc-gh-dszmolka sfc-gh-dszmolka added status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. and removed status-pr_pending_merge A PR is made and is under review labels Feb 21, 2024
@sfc-gh-dszmolka
Copy link
Contributor

PR is now merged and will be part of the next release which is imminent.

@sfc-gh-dszmolka
Copy link
Contributor

fix released with version 3.0.0, closing Issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector.
Projects
None yet
Development

No branches or pull requests

4 participants