Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
7a38399
Translation obligations: batch 1, arithmetic operators and numeric fu…
kvlonge Nov 5, 2026
f607637
Translation obligations: batch 1 audit fixes
kvlonge Nov 5, 2026
2d5e2b0
Translation obligations: batch 1 audit notes
kvlonge Nov 5, 2026
e8691b6
Use underscore case ids in the D151 batch 1 cases
kvlonge Nov 5, 2026
28714ad
Translation obligations: batch 2, string and binary functions
kvlonge Nov 5, 2026
6c48c19
Declare compile errors on two batch 1 error-parity cases
kvlonge Nov 5, 2026
1f5392c
Translation obligations: batch 3, date and time functions
kvlonge Nov 5, 2026
5633dee
Translation obligations: batch 2 audit fixes
kvlonge Nov 5, 2026
a52580d
Translation obligations: batch 4, conditional expressions
kvlonge Nov 5, 2026
e7e0c46
Translation obligations: batch 3 audit fixes
kvlonge Nov 5, 2026
bd8a685
Translation obligations: batch 1 capture follow-ups
kvlonge Nov 5, 2026
44d0319
Translation obligations: batch 3 re-review and batch 4 audit fixes
kvlonge Nov 5, 2026
d327f90
Translation obligations: literal constant arguments in 14 string cases
kvlonge Nov 5, 2026
e615217
Translation obligations: batch 5, aggregate functions
kvlonge Nov 5, 2026
2e79a0a
evidence: record D151 batches 1 and 2 (numeric and string translation…
kvlonge Nov 5, 2026
c9d3dbd
Translation obligations: batch 1 and 2 capture follow-ups
kvlonge Nov 5, 2026
3f956f3
Translation obligations: batch 3/4 compile screen follow-ups
kvlonge Nov 5, 2026
65e3f47
Translation obligations: batch 5 audit fixes, and AGG not translatable
kvlonge Nov 5, 2026
00899bb
Translation obligations: batch 5 wording, and the AGG sign-off
kvlonge Nov 5, 2026
9b7efd8
Merge commit '2e79a0af' into evidence/d151-3f956f3c
kvlonge Nov 5, 2026
bd91e07
Evidence: D151 batch 3/4 and collation t001 results at 3f956f3c
kvlonge Nov 5, 2026
0950e97
Merge commit '65e3f473' into evidence/d151-3f956f3c
kvlonge Nov 5, 2026
8834938
Evidence: D151 batch 5 (aggregate) results at 65e3f473
kvlonge Nov 5, 2026
488d630
Translation obligations: cases the Snowflake screen refused
kvlonge Nov 5, 2026
61f8ec1
Translation obligations: format TIME results with nine fractional digits
kvlonge Nov 5, 2026
74abd67
Translation obligations: array functions
kvlonge Nov 5, 2026
4597ce9
Merge commit '61f8ec1a' into evidence/d151-3f956f3c
kvlonge Nov 5, 2026
ed10451
Evidence: D151 held-case fixes at 61f8ec1a
kvlonge Nov 5, 2026
47eaff0
Translation obligations: sharper array minimum and maximum rows
kvlonge Nov 5, 2026
628de7a
Translation obligations: VARIANT type tests and casts
kvlonge Nov 5, 2026
85afe02
Translation obligations: TO_OBJECT errors and timestamp formats
kvlonge Nov 5, 2026
ce7f232
Merge commit '47eaff05' into evidence/d151-3f956f3c
kvlonge Nov 5, 2026
9d13dc3
Evidence: D151 batch 6a (array functions) at 47eaff05
kvlonge Nov 5, 2026
23c97cf
Translation obligations: ARRAY_TO_STRING on a JSON null is an error case
kvlonge Nov 5, 2026
798de5d
Merge commit '85afe023' into evidence/d151-3f956f3c
kvlonge Nov 5, 2026
ff3de3f
Evidence: D151 batch 6b (VARIANT type tests and casts) at 85afe023
kvlonge Nov 5, 2026
35abfab
Translation obligations: TO_OBJECT on text holding an object
kvlonge Nov 5, 2026
8344635
Translation obligations: paths, maps, objects, JSON and XML
kvlonge Nov 5, 2026
fa13a36
Translation obligations: NULL rows for maps and XML
kvlonge Nov 5, 2026
170000d
Translation obligations: conversion and bitwise functions
kvlonge Nov 5, 2026
3429ed1
Translation obligations: window, period and data generation functions
kvlonge Nov 5, 2026
8b5813a
Translation obligations: sharper bitwise rows and neutral conversion …
kvlonge Nov 6, 2026
7edfaab
Translation obligations: PERIOD_EQUALS pairs that separate begins and…
kvlonge Nov 6, 2026
ef57580
Translation obligations: context, encryption and vector functions
kvlonge Nov 6, 2026
140c9b5
Translation obligations: three semi-structured cases Snowflake refused
kvlonge Nov 6, 2026
cf2b3e3
Translation obligations: vector results rounded clear of a boundary
kvlonge Nov 6, 2026
ca8b8f4
Translation obligations: TO_BOOLEAN on a FLOAT is refused when compiling
kvlonge Nov 6, 2026
5a3f065
Translation obligations: two window errors at the stage Snowflake rai…
kvlonge Nov 6, 2026
afa189a
Translation obligations: geospatial conversion functions
kvlonge Nov 6, 2026
95308d3
Translation obligations: geometry SRID notes cite the pages
kvlonge Nov 6, 2026
371a0e9
Translation obligations: H3 functions
kvlonge Nov 6, 2026
dc5b59b
Merge commit 'ca8b8f48' into evidence/d151-3f956f3c
kvlonge Nov 6, 2026
d98acc5
Evidence: D151 batch 6c (paths, maps, objects, JSON and XML) at ca8b8f48
kvlonge Nov 6, 2026
e45dd5e
Translation obligations: invalid-shape H3 coverage left to the recording
kvlonge Nov 6, 2026
ab3e25d
Evidence: D151 batch 6d (conversion and bitwise functions) at ca8b8f48
kvlonge Nov 6, 2026
5129cdd
Translation obligations: context and vector cases Snowflake refused
kvlonge Nov 6, 2026
ce49606
Translation obligations: semi-structured and conversion cases as reco…
kvlonge Nov 6, 2026
128ec1b
Translation obligations: geospatial functions
kvlonge Nov 6, 2026
5261cdb
Translation obligations: bitwise NULL cases cite the page
kvlonge Nov 6, 2026
bf131bd
Translation obligations: geospatial NULL distance and collapsed shapes
kvlonge Nov 6, 2026
28be05e
Translation obligations: remaining callable functions and a DMF pilot
kvlonge Nov 6, 2026
59efe22
Translation obligations: compare geographies as WKT
kvlonge Nov 6, 2026
3823e51
Translation obligations: TO_QUERY NULL bind argument and a sharper mean
kvlonge Nov 6, 2026
a42b574
Merge commit 'ce4960686d0323e9077dccd9b50f3259d96d5792' into evidence…
kvlonge Nov 6, 2026
cd1c7dc
Evidence: D151 batch 6f (context, encryption and vector functions) at…
kvlonge Nov 6, 2026
64db648
Translation obligations: current database and schema as recorded
kvlonge Nov 6, 2026
d80b94e
Evidence: D151 batch 6c/6d follow-up (MAP_INSERT NULL key, bitwise NU…
kvlonge Nov 6, 2026
23aa188
Translation obligations: 6j cases as Snowflake compiled them
kvlonge Nov 6, 2026
bd3c89a
Translation obligations: MD5_NUMBER excluded as obsoleted
kvlonge Nov 6, 2026
8248053
Build the PERIOD_CONTAINS instant case from columns
kvlonge Nov 6, 2026
93aefed
Record the auditor's sign-off of the obsoleted-functions group
kvlonge Nov 6, 2026
fe2b67b
Measure the ST_CENTROID collection rule on GEOGRAPHY
kvlonge Nov 6, 2026
5c7621d
Merge commit '59efe2237c3c8eb67b0cf78be82e45397de78ac8' into evidence…
kvlonge Nov 6, 2026
f47ffa8
Evidence: D151 batch 6g (geospatial conversion) at 59efe223, error_pa…
kvlonge Nov 6, 2026
7fcd471
Evidence: D151 batch 6h (H3 functions) at 59efe223, error_parity case…
kvlonge Nov 6, 2026
3614211
Record the TO_QUERY NULL bind as a compile error
kvlonge Nov 6, 2026
6dd4e28
Keep the null tag on the TO_QUERY NULL bind case
kvlonge Nov 6, 2026
52501df
Merge commit 'fe2b67b63e44a498544c377dc60cb541a2b50333' into evidence…
kvlonge Nov 6, 2026
ecf15ac
Count external and dynamic tables, catalogue listings and file loading
kvlonge Nov 6, 2026
1c90c42
Evidence: D151 batch 6i (geospatial functions) at fe2b67b6, error_par…
kvlonge Nov 6, 2026
872a293
Declare the policy divergence each guarded translation case raises
kvlonge Nov 6, 2026
e18440c
Evidence: D151 batch 6e (window, PERIOD, random and sequence function…
kvlonge Nov 6, 2026
473cc44
Expect the compile refusal of an unknown compression method
kvlonge Nov 6, 2026
1b373d2
Record the auditor's re-sign-off of five not-translatable groups
kvlonge Nov 6, 2026
05db2b3
Merge commit '6dd4e282b8288bbda21d336de2d77bfcac87414a' into evidence…
kvlonge Nov 6, 2026
fad197d
Evidence: D151 batch 6j (ACCUMULATE, FORMAT_STRING_TEMPLATE, GENERATO…
kvlonge Nov 6, 2026
8f9f821
Merge the per-form translation obligations
kvlonge Nov 6, 2026
f90c2dc
Merge the recorded translation evidence
kvlonge Nov 6, 2026
781055e
Add the translation case category to the policy
kvlonge Nov 6, 2026
ae80feb
Hold eight forms out of this landing
kvlonge Nov 6, 2026
89d6d5d
Drop an internal reference from the obligation file headers
kvlonge Nov 6, 2026
5b0f17d
Hold GROUPING and GROUPING_ID out of this landing
kvlonge Nov 6, 2026
eca222a
Link the constructs the translation cases introduce
kvlonge Nov 6, 2026
81ef62d
Merge main into the translation landing
kvlonge Nov 6, 2026
73359ae
Re-record the translation results baseline for the per-form obligations
kvlonge Nov 6, 2026
dc4c463
Convert LAG and LEAD with a negative literal offset (D215)
kvlonge Nov 6, 2026
fee3e7b
Convert POSITION and CHARINDEX with a start position (D215)
kvlonge Nov 6, 2026
d60c74a
Convert SPLIT_PART with a delimiter from a column (D215)
kvlonge Nov 6, 2026
0697236
GENERATOR: constant ROWCOUNT expressions, NULL and absent arguments
kvlonge Nov 6, 2026
0e33af3
POSITION start: bind needle, text and start once
kvlonge Nov 6, 2026
05cd56c
Catalogue: describe the D215 limits for GENERATOR, SPLIT_PART, POSITI…
kvlonge Nov 6, 2026
ca57db4
Translation baseline: 5 forms and 19 statements now match
kvlonge Nov 6, 2026
7134598
cases: record POSITION and CHARINDEX with an empty needle and a start…
kvlonge Nov 6, 2026
0fb6475
cases: record REGEXP_SUBSTR with position, occurrence and group outsi…
kvlonge Nov 6, 2026
74f379f
evidence: record POSITION and CHARINDEX empty-needle starts and REGEX…
kvlonge Nov 6, 2026
b843215
POSITION start: an empty needle past the end of the text gives 0
kvlonge Nov 6, 2026
e140c0f
Translation baseline: A's 12 new D215 statements
kvlonge Nov 6, 2026
4ce4490
POSITION start: NULL text or needle gives NULL
kvlonge Nov 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
133 changes: 133 additions & 0 deletions cases/translation/expressions/operators-arithmetic.add.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
category = "translation"
construct = "sf.expressions.operators-arithmetic.add"
session_profile = "utc-v1"

[[case]]
id = "t001_num_num_380380"
description = "a NUMBER(38,0) + b NUMBER(38,0). Catches: operands swapped for subtraction or truncated to 32 bits"
columns = [{ name = "a", type = "NUMBER(38,0)" }, { name = "b", type = "NUMBER(38,0)" }]
rows = [
["7", "-12"],
["40000000000", "3"],
]
query = "SELECT a + b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t002_num_num_102380"
description = "a NUMBER(10,2) + b NUMBER(38,0). Catches: the sum losing the NUMBER(10,2) scale (4 instead of 4.25)"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "NUMBER(38,0)" }]
rows = [
["1.25", "3"],
["-0.75", "2"],
]
query = "SELECT a + b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t003_num_num_102124"
description = "a NUMBER(10,2) + b NUMBER(12,4). Catches: the result scale taken from the left operand only (1.31 instead of 1.3125)"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "NUMBER(12,4)" }]
rows = [
["1.25", "0.0625"],
["-3.10", "1.0001"],
]
query = "SELECT a + b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t004_num_float_380"
description = "a NUMBER(38,0) + b FLOAT. Catches: a FLOAT operand rounded to the integer side"
columns = [{ name = "a", type = "NUMBER(38,0)" }, { name = "b", type = "FLOAT" }]
rows = [
["3", "0.5"],
["-2", "1e-3"],
]
query = "SELECT a + b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t005_num_float_102"
description = "a NUMBER(10,2) + b FLOAT. Catches: the FLOAT operand cast to NUMBER(10,2) (1.00 instead of 1.001) or a fixed-point result type"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "FLOAT" }]
rows = [
["0.10", "0.2"],
["2.50", "-0.25"],
["1.00", "0.001"],
]
query = "SELECT a + b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t006_float_float"
description = "a FLOAT + b FLOAT. Catches: float addition replaced by decimal addition (0.30000000000000004 vs 0.3)"
columns = [{ name = "a", type = "FLOAT" }, { name = "b", type = "FLOAT" }]
rows = [
["0.1", "0.2"],
["1e16", "1"],
]
query = "SELECT a + b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t007_null_a"
description = "NULL as a, the other operand set. Catches: NULL treated as 0 instead of propagating"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "NUMBER(10,2)" }]
rows = [
["NULL", "2.50"],
]
query = "SELECT a + b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["null"]

[[case]]
id = "t008_null_b"
description = "NULL as b, the other operand set. Catches: NULL treated as 0 instead of propagating"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "NUMBER(10,2)" }]
rows = [
["2.50", "NULL"],
]
query = "SELECT a + b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["null"]

[[case]]
id = "t009_max_38"
description = "38-digit integers that still fit. Catches: arithmetic done in 64 bits"
columns = [{ name = "a", type = "NUMBER(38,0)" }, { name = "b", type = "NUMBER(38,0)" }]
rows = [
["9999999999999999999999999999999999999", "9"],
["-9999999999999999999999999999999999999", "-9"],
]
query = "SELECT a + b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["boundary"]

[[case]]
id = "t010_negatives"
description = "Negative fixed-point sums crossing zero. Catches: sign lost or magnitude added"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "NUMBER(10,2)" }]
rows = [
["-5.25", "2.00"],
["-0.01", "0.02"],
]
query = "SELECT a + b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["boundary"]

[[case]]
id = "t011_overflow"
description = "The sum of two 38-digit integers overflows NUMBER(38,0). Catches: wrapping or a silent switch to FLOAT instead of the out-of-range error"
columns = [{ name = "a", type = "NUMBER(38,0)" }, { name = "b", type = "NUMBER(38,0)" }]
rows = [
["99999999999999999999999999999999999999", "99999999999999999999999999999999999999"],
]
query = "SELECT a + b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["error"]
133 changes: 133 additions & 0 deletions cases/translation/expressions/operators-arithmetic.divide.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
category = "translation"
construct = "sf.expressions.operators-arithmetic.divide"
session_profile = "utc-v1"

[[case]]
id = "t001_num_num_380380"
description = "a NUMBER(38,0) / b NUMBER(38,0). Catches: integer division (3 instead of 3.5) or a truncated rather than rounded scale-6 quotient (0.666666 vs 0.666667)"
columns = [{ name = "a", type = "NUMBER(38,0)" }, { name = "b", type = "NUMBER(38,0)" }]
rows = [
["7", "2"],
["-7", "2"],
["2", "3"],
]
query = "SELECT a / b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t002_num_num_102380"
description = "a NUMBER(10,2) / b NUMBER(38,0). Catches: the quotient scale (s+6) handled wrongly"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "NUMBER(38,0)" }]
rows = [
["1.25", "4"],
["-10.00", "3"],
]
query = "SELECT a / b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t003_num_num_102124"
description = "a NUMBER(10,2) / b NUMBER(12,4). Catches: quotient scale taken from the divisor"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "NUMBER(12,4)" }]
rows = [
["1.00", "0.0300"],
["5.50", "2.2000"],
]
query = "SELECT a / b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t004_num_float_380"
description = "a NUMBER(38,0) / b FLOAT. Catches: FLOAT divisor rounded"
columns = [{ name = "a", type = "NUMBER(38,0)" }, { name = "b", type = "FLOAT" }]
rows = [
["1", "3.0"],
["-5", "0.25"],
]
query = "SELECT a / b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t005_num_float_102"
description = "a NUMBER(10,2) / b FLOAT. Catches: fixed-point / FLOAT result type swapped"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "FLOAT" }]
rows = [
["1.00", "8.0"],
["3.00", "-0.5"],
]
query = "SELECT a / b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t006_float_float"
description = "a FLOAT / b FLOAT. Catches: float division done in decimal"
columns = [{ name = "a", type = "FLOAT" }, { name = "b", type = "FLOAT" }]
rows = [
["1", "3"],
["-0.5", "4"],
]
query = "SELECT a / b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t007_null_a"
description = "NULL as a, the other operand set. Catches: NULL treated as 0"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "NUMBER(10,2)" }]
rows = [
["NULL", "2.00"],
]
query = "SELECT a / b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["null"]

[[case]]
id = "t008_null_b"
description = "NULL as b, the other operand set. Catches: NULL divisor turned into the division-by-zero error or 0"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "NUMBER(10,2)" }]
rows = [
["2.00", "NULL"],
]
query = "SELECT a / b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["null"]

[[case]]
id = "t009_scale_12"
description = "Scales near the 12-digit quotient cap. Catches: the quotient scale not capped at 12"
columns = [{ name = "a", type = "NUMBER(20,8)" }, { name = "b", type = "NUMBER(20,8)" }]
rows = [
["1.00000000", "3.00000000"],
["2.00000000", "7.00000000"],
]
query = "SELECT a / b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["boundary"]

[[case]]
id = "t010_neg_quotient"
description = "Negative quotients that round at the last digit. Catches: rounding toward zero instead of half away from zero"
columns = [{ name = "a", type = "NUMBER(38,0)" }, { name = "b", type = "NUMBER(38,0)" }]
rows = [
["-2", "3"],
["-1", "6"],
]
query = "SELECT a / b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["boundary"]

[[case]]
id = "t011_div_zero"
description = "Division by zero is an error. Catches: NULL, 0 or infinity instead of the division-by-zero error"
columns = [{ name = "a", type = "NUMBER(38,0)" }, { name = "b", type = "NUMBER(38,0)" }]
rows = [
["5", "0"],
]
query = "SELECT a / b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["error"]
120 changes: 120 additions & 0 deletions cases/translation/expressions/operators-arithmetic.modulo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
category = "translation"
construct = "sf.expressions.operators-arithmetic.modulo"
session_profile = "utc-v1"

[[case]]
id = "t001_num_num_380380"
description = "a NUMBER(38,0) % b NUMBER(38,0). Catches: floor-based modulo (2 instead of -1): MOD truncates toward zero"
columns = [{ name = "a", type = "NUMBER(38,0)" }, { name = "b", type = "NUMBER(38,0)" }]
rows = [
["-7", "3"],
["7", "-3"],
["7", "3"],
]
query = "SELECT a % b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t002_num_num_102380"
description = "a NUMBER(10,2) % b NUMBER(38,0). Catches: fractional remainder dropped"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "NUMBER(38,0)" }]
rows = [
["7.50", "2"],
["-7.50", "2"],
]
query = "SELECT a % b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t003_num_num_102124"
description = "a NUMBER(10,2) % b NUMBER(12,4). Catches: result scale taken from one operand"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "NUMBER(12,4)" }]
rows = [
["5.25", "1.0001"],
["-0.75", "0.5000"],
]
query = "SELECT a % b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t004_num_float_380"
description = "a NUMBER(38,0) % b FLOAT. Catches: FLOAT divisor rounded"
columns = [{ name = "a", type = "NUMBER(38,0)" }, { name = "b", type = "FLOAT" }]
rows = [
["7", "2.5"],
["-7", "2.5"],
]
query = "SELECT a % b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t005_float_float"
description = "a FLOAT % b FLOAT. Catches: floor-based float modulo"
columns = [{ name = "a", type = "FLOAT" }, { name = "b", type = "FLOAT" }]
rows = [
["5.5", "2"],
["-5.5", "2"],
]
query = "SELECT a % b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["type-combination"]

[[case]]
id = "t006_null_a"
description = "NULL as a, the other operand set. Catches: NULL treated as 0"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "NUMBER(10,2)" }]
rows = [
["NULL", "3.00"],
]
query = "SELECT a % b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["null"]

[[case]]
id = "t007_null_b"
description = "NULL as b, the other operand set. Catches: NULL treated as 0"
columns = [{ name = "a", type = "NUMBER(10,2)" }, { name = "b", type = "NUMBER(10,2)" }]
rows = [
["3.00", "NULL"],
]
query = "SELECT a % b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["null"]

[[case]]
id = "t008_both_negative"
description = "Both operands negative. Catches: remainder made non-negative (Euclidean or ABS): 2 instead of -1 for -7 % -3, 4 instead of -1 for -1 % -5"
columns = [{ name = "a", type = "NUMBER(38,0)" }, { name = "b", type = "NUMBER(38,0)" }]
rows = [
["-7", "-3"],
["-1", "-5"],
]
query = "SELECT a % b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["boundary"]

[[case]]
id = "t009_mod_text"
description = "A non-numeric string operand. Catches: the string silently read as 0 instead of the conversion error"
columns = [{ name = "a", type = "VARCHAR" }, { name = "b", type = "NUMBER(38,0)" }]
rows = [
["'abc'", "3"],
]
query = "SELECT a % b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["error"]

[[case]]
id = "t010_zero_divisor"
description = "A zero divisor: records what Snowflake returns there; re-kinded to boundary after capture if Snowflake returns a value instead of an error. Catches: NULL for x % 0 (DuckDB) where Snowflake raises division by zero"
columns = [{ name = "a", type = "NUMBER(38,0)" }, { name = "b", type = "NUMBER(38,0)" }]
rows = [
["5", "0"],
]
query = "SELECT a % b AS r FROM input ORDER BY ordinal"
order = "ordered"
tags = ["error"]
Loading
Loading