Skip to content

Chunk going missing #24

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

Closed
mbwilding opened this issue Jul 7, 2022 · 5 comments
Closed

Chunk going missing #24

mbwilding opened this issue Jul 7, 2022 · 5 comments

Comments

@mbwilding
Copy link

mbwilding commented Jul 7, 2022

Hey, sometimes the first chunk in a large query will not be included in the aggregated final result.
Have you experienced this? Potentially a SF issue but unsure. Running in a AWS .NET 6 lambda.

@fixer-m
Copy link
Owner

fixer-m commented Jul 12, 2022

@mbwilding Hi!
Well, that's weird. I tried different queries and always got the first chunk data.
I would suggest to check total rows count in response metadata and rows count that aggregated result contains (they should be equal):

var result = await _snowflakeClient.QueryRawResponseAsync("select top 10000 * from SNOWFLAKE_SAMPLE_DATA.TPCH_SF1000.SUPPLIER;");

var chunksDownloadInfo = new ChunksDownloadInfo() { ChunkHeaders = result.ChunkHeaders, Chunks = result.Chunks, Qrmk = result.Qrmk };
var parsed = await ChunksDownloader.DownloadAndParseChunksAsync(chunksDownloadInfo);

var totalRowCountInChunks = result.Chunks.Sum(c => c.RowCount);
Assert.AreEqual(totalRowCountInChunks, parsed.Count); 

As well as you can check rows in a first chunk from raw response - does it actually contains first rows from query result? Or it contains rows from result with some offset? (That will prove that SF just didn't returned first chunk and returned second instead, for instance).

@mbwilding
Copy link
Author

mbwilding commented Jul 25, 2022

Untitled
Here is what I mean. Happening in windows too apparently. 0.4.0 added to project so I can debug, usually use the nuget.

@mbwilding
Copy link
Author

1
2

@fixer-m
Copy link
Owner

fixer-m commented Oct 10, 2022

@mbwilding Hi! This issue was fixed in 0.4.1. Turns out that SF API sometimes returns rows in "chunks" and in a "rowset" at the same time.

@fixer-m fixer-m closed this as completed Nov 12, 2022
@fixer-m
Copy link
Owner

fixer-m commented Nov 12, 2022

Fixed in 0.4.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants