Skip to content

Add new golden files with VARIANT values#6140

Merged
mihaibudiu merged 2 commits into
feldera:mainfrom
mihaibudiu:issue6132
Apr 28, 2026
Merged

Add new golden files with VARIANT values#6140
mihaibudiu merged 2 commits into
feldera:mainfrom
mihaibudiu:issue6132

Conversation

@mihaibudiu
Copy link
Copy Markdown
Contributor

Fixes #6132

@mihaibudiu mihaibudiu requested a review from gz April 27, 2026 21:57

// There are 24 kinds of variant
pub type GoldenRowVariant = Tup25<
Variant,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make some of them Option to get more coverage (maybe every 2nd one?), it changes the layout

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no option Variant values. A NULL is stored as a NULL value at runtime.

pub fn golden_row_variant(row: usize) -> GoldenRowVariant {
let row_u64 = 0x0101_0000_0000_0000u64.wrapping_add(row as u64);

// This has the me monotone
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're not building any nested variants here? should we?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no nested variants - we are building one of each of the possible types.
The only array supported is VARIANT ARRAY.
Similar for MAP.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be full coverage of the Variant enum type in this test.

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
@mihaibudiu mihaibudiu added this pull request to the merge queue Apr 27, 2026
Copy link
Copy Markdown

@mythical-fred mythical-fred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Two small comment nits inline.

// None optimization added to larger tups with the v4 storage format.
pub type GoldenRowSmall = Tup8<u64, bool, i32, i64, F32, SqlString, Opt<i32>, Opt<ByteArray>>;

// There are 24 kinds of variant
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: there are actually 25 Variant variants (SqlNull, VariantNull, Boolean, TinyInt, SmallInt, Int, BigInt, UTinyInt, USmallInt, UInt, UBigInt, Real, Double, SqlDecimal, String, Date, Time, Timestamp, ShortInterval, LongInterval, Binary, Geometry, Uuid, Array, Map) — which matches Tup25 and the 25 fields you build in golden_row_variant. The comment understates by one.

pub fn golden_row_variant(row: usize) -> GoldenRowVariant {
let row_u64 = 0x0101_0000_0000_0000u64.wrapping_add(row as u64);

// This has the me monotone
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: // This has the me monotone — should be // This has to be monotone (or just merge with the comment a few lines below).

Merged via the queue into feldera:main with commit e4c1a4a Apr 28, 2026
1 check passed
@mihaibudiu mihaibudiu deleted the issue6132 branch April 28, 2026 00:41
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

Successfully merging this pull request may close these issues.

[SQLLIB] Adapt the storage tests to handle multiple VARIANT values

3 participants