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-1657238: SnowflakeDbCommand.ExecuteNonQueryAsync returns incorrect count; only includes from first row when loading from Stage #1023

Open
brtubb-patagonia opened this issue Sep 9, 2024 · 2 comments
Assignees
Labels
bug status-pr_pending_merge A PR is made and is under review status-triage_done Initial triage done, will be further handled by the driver team

Comments

@brtubb-patagonia
Copy link

  1. What version of .NET driver are you using?
    Reproduced on 4.1.0 and 4.0.0.

  2. What operating system and processor architecture are you using?
    Windows 11 on Microsoft Dev Box in Azure (reports Intel Xeon Platinum 8370C)
    Also seeing issue in Azure App Service Plan (I1V2 tier. Not sure what that runs on)

  3. What version of .NET framework are you using?
    .Net 8.0

  4. What did you do?
    Repro steps (all running in a console app) -

  • Put >1 file in blob storage folder (stage source)
  • Create temp table in Snowflake
  • Load into temp table using COPY INTO from the stage folder (using ExecuteNonQueryAsync)
  • Retrieve record count from ExecuteNonQueryAsync return value
  • Note the incorrect record count
  1. What did you expect to see?
    I'm expecting to see the number of rows loaded to the table from stage. Instead it's returning only the number of records from the first file loaded.

image

The record count returned is only for the first record and doesn't properly aggregate the results.

image

Debugging the code a bit, it looks like there is an issue reading the resultset returned. It doesn't think there is more than one result.
image

When digging into the ResultSetUtil.CalculateUpdateCount, which looks to handle the nuances of record counts for various operations, it is aware of both rows, as evident in the private _currentChunk variable.
image

  1. Can you set logging to DEBUG and collect the logs?

Debug logs attached.
snowflake_dotnet4.log

  1. What is your Snowflake account identifier, if any? (Optional)
@github-actions github-actions bot changed the title SnowflakeDbCommand.ExecuteNonQueryAsync returns incorrect count; only includes from first row when loading from Stage SNOW-1657238: SnowflakeDbCommand.ExecuteNonQueryAsync returns incorrect count; only includes from first row when loading from Stage Sep 9, 2024
@sfc-gh-dszmolka sfc-gh-dszmolka self-assigned this Sep 10, 2024
@sfc-gh-dszmolka sfc-gh-dszmolka added the status-triage Issue is under initial triage label Sep 10, 2024
@sfc-gh-dszmolka
Copy link
Contributor

hi and thanks for raising this issue with us, especially for providing so much details on it! we'll take a look.

@sfc-gh-dszmolka sfc-gh-dszmolka added status-triage_done Initial triage done, will be further handled by the driver team and removed status-triage Issue is under initial triage labels Sep 10, 2024
@sfc-gh-dszmolka sfc-gh-dszmolka added the status-in_progress Issue is worked on by the driver team label Sep 26, 2024
@sfc-gh-dszmolka
Copy link
Contributor

PR in review: #1044

@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 Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status-pr_pending_merge A PR is made and is under review status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

3 participants