Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
…y format Snowflake's VARIANT type has a 16MB per-row limit. The current format writes each stage's output as a single JSON object (e.g., 195MB for embeddings), which exceeds this limit and causes external tables to silently return 0 rows despite files being registered. Switch all pipeline stages (converted, chunks, embeddings) to output JSON arrays of flat row objects. With STRIP_OUTER_ARRAY=TRUE already configured on the external tables, each array element becomes its own row, keeping VARIANT values well under the 16MB limit. All readers handle both old (single-object) and new (array) formats for backward compatibility during migration.
The nilerr linter flags cases where a non-nil error is returned as nil. In these fallback unmarshal paths, returning nil error is intentional — an unparseable file means it should be re-processed, not that the reconciler failed.
The nilerr linter flags the return line, not the if line, so the directive must be on the return statement to suppress the warning.
The nilerr linter does not fire on this line, so the nolint directive triggers nolintlint for being unnecessary.
concaf
force-pushed
the
fix/snowflake-flat-array-format
branch
from
September 6, 2026 11:32
7a22f1e to
70824e0
Compare
Drop all fallback paths that read the old single-object format (ConvertedFile, ChunksFile, EmbeddingsFile). All controllers now only read and write the new flat array format (ConvertedRow, ChunkRow, EmbeddingRow). Old-format files will fail to parse and trigger re-processing into the new format.
Remove readConvertedFile and readChunksFile helpers that were not in the original code. Inline the retrieve+unmarshal logic in each caller, matching the original code structure with only the type swap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EXTERNAL_TABLE_FILE_REGISTRATION_HISTORY.STRIP_OUTER_ARRAY=TRUEalready set on the external tables, each array element becomes its own row (~10KB each), well under the 16MB limit.ConvertedRow,ChunkRow,EmbeddingRow) and update all controllers to write the new format while reading both old and new formats for backward compatibility.Companion DPO MR: Updates materialized views to read the flat row format (no more LATERAL FLATTEN needed).
Test plan
aiftestgdrivear)select count(*) from <db>.staging.embeddings_ext_tblreturns > 0select count(*) from <db>.staging.chunks_ext_tblreturns > 0EMBEDDINGS_MV,CHUNKS_MV,CONVERTED_MV) return correct data