Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e6d1781
fix(databricks): link each statement only to the forms it writes
kvlonge Dec 5, 2026
8cadf79
feat(databricks): key the forms only their own hand cases show
kvlonge Dec 5, 2026
3033daa
Merge remote-tracking branch 'origin/main' into fix/databricks-form-l…
kvlonge Dec 5, 2026
354716d
fix(databricks): credit ORDER BY COLLATE only for UTF8_LCASE
kvlonge Dec 5, 2026
97e7b52
Merge remote-tracking branch 'origin/feat/databricks-cited-form-keys'…
kvlonge Dec 5, 2026
87857f4
feat(coverage): key the Databricks spellings that share a node
kvlonge Dec 5, 2026
ccf10f9
Merge remote-tracking branch 'origin/main' into feat/databricks-reade…
kvlonge Dec 5, 2026
a21750f
fix(syntax-coverage): read array_sort's comparator as optional
kvlonge Dec 5, 2026
60585c8
Pin the Databricks evidence with session 4's cases
kvlonge Dec 5, 2026
d20f2ef
Merge remote-tracking branch 'origin/main' into fix/databricks-form-l…
kvlonge Dec 5, 2026
7e4ab92
chore(coverage): re-record the Databricks results after merging main
kvlonge Dec 5, 2026
bae058b
Merge remote-tracking branch 'origin/main' into feat/databricks-cited…
kvlonge Dec 5, 2026
aaecfa2
Merge remote-tracking branch 'origin/main' into feat/databricks-sessi…
kvlonge Dec 5, 2026
afad9be
chore(coverage): re-record the Databricks results after merging main
kvlonge Dec 5, 2026
03bc37f
Merge remote-tracking branch 'origin/fix/databricks-form-links' into …
kvlonge Dec 5, 2026
580e2af
Merge branch 'feat/databricks-cited-form-keys' into feat/databricks-r…
kvlonge Dec 5, 2026
387bcb1
chore(coverage): re-record the Databricks results on the updated #492…
kvlonge Dec 6, 2026
424f302
fix(coverage): cite array_sort's one-argument case again under a new …
kvlonge Dec 6, 2026
a0b38fc
chore(coverage): re-record the Databricks results on session 4's evid…
kvlonge Dec 6, 2026
aeef235
Merge remote-tracking branch 'origin/main' into fix/databricks-form-l…
kvlonge Dec 6, 2026
8b5d256
Merge remote-tracking branch 'origin/main' into feat/databricks-cited…
kvlonge Dec 6, 2026
2019482
Merge remote-tracking branch 'origin/fix/databricks-form-links' into …
kvlonge Dec 6, 2026
e764d46
chore(coverage): re-record the Databricks results after merging the f…
kvlonge Dec 6, 2026
8a14153
Merge branch 'feat/databricks-cited-form-keys' into feat/databricks-r…
kvlonge Dec 6, 2026
81f9d5a
Merge branch 'feat/databricks-reader-keys' into feat/databricks-sessi…
kvlonge Dec 6, 2026
3cba3d9
docs(databricks): name the partial-state merge in central_moment_orde…
kvlonge Dec 6, 2026
60c4b34
Merge remote-tracking branch 'origin/main' into feat/databricks-sessi…
kvlonge Dec 6, 2026
808b0f1
Merge remote-tracking branch 'origin/main' into test/databricks-stati…
kvlonge Dec 6, 2026
c6761fd
Merge remote-tracking branch 'origin/main' into feat/databricks-sessi…
kvlonge Dec 6, 2026
af3eee2
Merge branch 'feat/databricks-session-4' into test/databricks-statist…
kvlonge Dec 6, 2026
095889a
fix(coverage): drop the Databricks links of the undocumented MAX_PART…
kvlonge Dec 6, 2026
ae8e09d
chore(coverage): pin the Databricks evidence with the statistics aggr…
kvlonge Dec 6, 2026
5643570
Merge branch 'feat/databricks-session-4' into test/databricks-statist…
kvlonge Dec 6, 2026
762bc25
chore(coverage): sign the Databricks form links and record the array-…
kvlonge Dec 6, 2026
1085818
Merge branch 'feat/databricks-session-4' into test/databricks-statist…
kvlonge Dec 6, 2026
953aaf5
chore(coverage): re-record the Databricks results baseline with the c…
kvlonge Dec 6, 2026
7396ce3
Merge remote-tracking branch 'origin/main' into feat/databricks-sessi…
kvlonge Dec 6, 2026
aa6b5de
chore(coverage): re-sign the Databricks function links for the option…
kvlonge Dec 6, 2026
8627e8e
chore(coverage): pin the Databricks evidence with session 4's rebuilt…
kvlonge Dec 6, 2026
0255a99
Merge branch 'feat/databricks-session-4' into test/databricks-statist…
kvlonge Dec 6, 2026
fc19358
Merge remote-tracking branch 'origin/main' into test/databricks-stati…
kvlonge Dec 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions coverage/translation-databricks/obligations/functions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6043,6 +6043,39 @@ reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/convert-timezone.toml#t010_wrong_kind"]
required = true

[[obligation]]
id = "db.functions.corr.t008"
form = "db.functions.corr"
kind = "type_combination"
target = "DOUBLE, DOUBLE"
note = "corr where the first argument never varies. Expected NULL, from Spark's Corr: its result is NULL when either accumulated second moment is exactly zero, where the coefficient's formula divides by zero. Hand-written."
catches = "the argument types read another way, or the result typed otherwise"
reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/corr.constant.hand.toml#c001"]
required = true

[[obligation]]
id = "db.functions.corr.t009"
form = "db.functions.corr"
kind = "type_combination"
target = "INT, INT"
note = "corr where the second argument never varies. Expected NULL, from Spark's Corr: the same zero-moment branch, on the other argument. Hand-written."
catches = "the argument types read another way, or the result typed otherwise"
reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/corr.constant.hand.toml#c002"]
required = true

[[obligation]]
id = "db.functions.corr.t010"
form = "db.functions.corr"
kind = "type_combination"
target = "INT, INT"
note = "corr of a single pair. Expected NULL, from Spark's Corr: a count of one returns its divide-by-zero result, NULL unless spark.sql.legacy.statisticalAggregate is set. Hand-written."
catches = "the argument types read another way, or the result typed otherwise"
reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/corr.constant.hand.toml#c003"]
required = true

[[obligation]]
id = "db.functions.corr.t001"
form = "db.functions.corr"
Expand Down Expand Up @@ -18033,6 +18066,28 @@ reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/kll-sketch-to-string-float.toml#t004_wrong_kind"]
required = true

[[obligation]]
id = "db.functions.kurtosis.t006"
form = "db.functions.kurtosis"
kind = "type_combination"
target = "DOUBLE"
note = "kurtosis of a value that never varies. Expected NULL, from Spark's Kurtosis: a second central moment of exactly zero returns its divide-by-zero result, NULL unless spark.sql.legacy.statisticalAggregate is set. Hand-written."
catches = "the argument types read another way, or the result typed otherwise"
reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/kurtosis.constant.hand.toml#c001"]
required = true

[[obligation]]
id = "db.functions.kurtosis.t007"
form = "db.functions.kurtosis"
kind = "type_combination"
target = "INT"
note = "kurtosis of a single value. Expected NULL, from Spark's Kurtosis: one value leaves the second central moment at zero, the same branch. Hand-written."
catches = "the argument types read another way, or the result typed otherwise"
reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/kurtosis.constant.hand.toml#c002"]
required = true

[[obligation]]
id = "db.functions.kurtosis.t001"
form = "db.functions.kurtosis"
Expand Down Expand Up @@ -26140,6 +26195,28 @@ reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/regr-count.toml#t011_wrong_kind"]
required = true

[[obligation]]
id = "db.functions.regr-intercept.t008"
form = "db.functions.regr-intercept"
kind = "type_combination"
target = "DOUBLE, DOUBLE"
note = "regr_intercept where x never varies. Expected NULL, from Spark's RegrIntercept: a population variance of x of exactly zero returns NULL, where the formula divides by zero. Hand-written."
catches = "the argument types read another way, or the result typed otherwise"
reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/regr-intercept.constant.hand.toml#c001"]
required = true

[[obligation]]
id = "db.functions.regr-intercept.t009"
form = "db.functions.regr-intercept"
kind = "type_combination"
target = "DOUBLE, DOUBLE"
note = "regr_intercept where y never varies and x does. Expected 2.5, from the formula: the intercept is the mean of y less a zero slope times the mean of x. Hand-written."
catches = "the argument types read another way, or the result typed otherwise"
reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/regr-intercept.constant.hand.toml#c002"]
required = true

[[obligation]]
id = "db.functions.regr-intercept.t001"
form = "db.functions.regr-intercept"
Expand Down Expand Up @@ -26217,6 +26294,28 @@ reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/regr-intercept.toml#t011_wrong_kind"]
required = true

[[obligation]]
id = "db.functions.regr-r2.t008"
form = "db.functions.regr-r2"
kind = "type_combination"
target = "DOUBLE, DOUBLE"
note = "regr_r2 where y never varies and x does. Expected 1.0, from Spark's RegrR2: with the dependent variable's second moment zero and the independent one's not, it returns 1.0. Hand-written."
catches = "the argument types read another way, or the result typed otherwise"
reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/regr-r2.constant.hand.toml#c001"]
required = true

[[obligation]]
id = "db.functions.regr-r2.t009"
form = "db.functions.regr-r2"
kind = "type_combination"
target = "DOUBLE, DOUBLE"
note = "regr_r2 where x never varies. Expected NULL, from Spark's RegrR2: with the independent variable's second moment zero it returns NULL. Hand-written."
catches = "the argument types read another way, or the result typed otherwise"
reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/regr-r2.constant.hand.toml#c002"]
required = true

[[obligation]]
id = "db.functions.regr-r2.t001"
form = "db.functions.regr-r2"
Expand Down Expand Up @@ -26294,6 +26393,28 @@ reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/regr-r2.toml#t011_wrong_kind"]
required = true

[[obligation]]
id = "db.functions.regr-slope.t008"
form = "db.functions.regr-slope"
kind = "type_combination"
target = "DOUBLE, DOUBLE"
note = "regr_slope where x never varies. Expected NULL, from Spark's RegrSlope: a population variance of x of exactly zero returns NULL, where the formula divides by zero. Hand-written."
catches = "the argument types read another way, or the result typed otherwise"
reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/regr-slope.constant.hand.toml#c001"]
required = true

[[obligation]]
id = "db.functions.regr-slope.t009"
form = "db.functions.regr-slope"
kind = "type_combination"
target = "DOUBLE, DOUBLE"
note = "regr_slope where y never varies and x does. Expected 0.0, from the formula: the co-moment of x with a constant y is zero, so the slope is zero over x's nonzero second moment. Hand-written."
catches = "the argument types read another way, or the result typed otherwise"
reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/regr-slope.constant.hand.toml#c002"]
required = true

[[obligation]]
id = "db.functions.regr-slope.t001"
form = "db.functions.regr-slope"
Expand Down Expand Up @@ -28670,6 +28791,28 @@ reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/size.toml#t007_wrong_kind"]
required = true

[[obligation]]
id = "db.functions.skewness.t006"
form = "db.functions.skewness"
kind = "type_combination"
target = "DOUBLE"
note = "skewness of a value that never varies. Expected NULL, from Spark's Skewness: a second central moment of exactly zero returns its divide-by-zero result, NULL unless spark.sql.legacy.statisticalAggregate is set. Hand-written."
catches = "the argument types read another way, or the result typed otherwise"
reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/skewness.constant.hand.toml#c001"]
required = true

[[obligation]]
id = "db.functions.skewness.t007"
form = "db.functions.skewness"
kind = "type_combination"
target = "INT"
note = "skewness of a single value. Expected NULL, from Spark's Skewness: one value leaves the second central moment at zero, the same branch. Hand-written."
catches = "the argument types read another way, or the result typed otherwise"
reading = "the argument types the generator read from the function's page"
cases = ["cases/translation/functions/skewness.constant.hand.toml#c002"]
required = true

[[obligation]]
id = "db.functions.skewness.t001"
form = "db.functions.skewness"
Expand Down
26 changes: 26 additions & 0 deletions coverage/translation-databricks/results-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,9 @@
"translation/functions/convert-timezone.toml#t008_boundary_3": "matching_error",
"translation/functions/convert-timezone.toml#t009_boundary_4": "matching_error",
"translation/functions/convert-timezone.toml#t010_wrong_kind": "matching_error",
"translation/functions/corr.constant.hand.toml#c001": "matching",
"translation/functions/corr.constant.hand.toml#c002": "matching",
"translation/functions/corr.constant.hand.toml#c003": "matching",
"translation/functions/corr.toml#t001_types_1": "matching",
"translation/functions/corr.toml#t002_types_2": "matching",
"translation/functions/corr.toml#t003_types_3": "matching",
Expand Down Expand Up @@ -2606,6 +2609,8 @@
"translation/functions/kll-sketch-to-string-float.toml#t002_null_1": "refused",
"translation/functions/kll-sketch-to-string-float.toml#t003_boundary_1": "refused",
"translation/functions/kll-sketch-to-string-float.toml#t004_wrong_kind": "refused",
"translation/functions/kurtosis.constant.hand.toml#c001": "matching",
"translation/functions/kurtosis.constant.hand.toml#c002": "matching",
"translation/functions/kurtosis.toml#t001_types_1": "matching",
"translation/functions/kurtosis.toml#t002_types_2": "matching",
"translation/functions/kurtosis.toml#t003_types_3": "matching",
Expand Down Expand Up @@ -3680,6 +3685,8 @@
"translation/functions/regr-count.toml#t009_boundary_3": "matching",
"translation/functions/regr-count.toml#t010_boundary_4": "matching",
"translation/functions/regr-count.toml#t011_wrong_kind": "matching_error",
"translation/functions/regr-intercept.constant.hand.toml#c001": "matching",
"translation/functions/regr-intercept.constant.hand.toml#c002": "matching",
"translation/functions/regr-intercept.toml#t001_types_1": "matching",
"translation/functions/regr-intercept.toml#t002_types_2": "matching",
"translation/functions/regr-intercept.toml#t003_types_3": "matching",
Expand All @@ -3691,6 +3698,8 @@
"translation/functions/regr-intercept.toml#t009_boundary_3": "matching",
"translation/functions/regr-intercept.toml#t010_boundary_4": "matching",
"translation/functions/regr-intercept.toml#t011_wrong_kind": "matching_error",
"translation/functions/regr-r2.constant.hand.toml#c001": "matching",
"translation/functions/regr-r2.constant.hand.toml#c002": "matching",
"translation/functions/regr-r2.toml#t001_types_1": "matching",
"translation/functions/regr-r2.toml#t002_types_2": "matching",
"translation/functions/regr-r2.toml#t003_types_3": "matching",
Expand All @@ -3702,6 +3711,8 @@
"translation/functions/regr-r2.toml#t009_boundary_3": "matching",
"translation/functions/regr-r2.toml#t010_boundary_4": "matching",
"translation/functions/regr-r2.toml#t011_wrong_kind": "matching_error",
"translation/functions/regr-slope.constant.hand.toml#c001": "matching",
"translation/functions/regr-slope.constant.hand.toml#c002": "matching",
"translation/functions/regr-slope.toml#t001_types_1": "matching",
"translation/functions/regr-slope.toml#t002_types_2": "matching",
"translation/functions/regr-slope.toml#t003_types_3": "matching",
Expand Down Expand Up @@ -4018,6 +4029,8 @@
"translation/functions/size.toml#t005_boundary_1": "matching",
"translation/functions/size.toml#t006_boundary_2": "matching",
"translation/functions/size.toml#t007_wrong_kind": "matching_rejection",
"translation/functions/skewness.constant.hand.toml#c001": "matching",
"translation/functions/skewness.constant.hand.toml#c002": "matching",
"translation/functions/skewness.toml#t001_types_1": "matching",
"translation/functions/skewness.toml#t002_types_2": "matching",
"translation/functions/skewness.toml#t003_types_3": "matching",
Expand Down Expand Up @@ -8568,6 +8581,9 @@
"db.functions.corr.t005": "met",
"db.functions.corr.t006": "met",
"db.functions.corr.t007": "met",
"db.functions.corr.t008": "met",
"db.functions.corr.t009": "met",
"db.functions.corr.t010": "met",
"db.functions.cos.t001": "met",
"db.functions.cos.t002": "met",
"db.functions.cos.t003": "met",
Expand Down Expand Up @@ -9656,6 +9672,8 @@
"db.functions.kurtosis.t003": "met",
"db.functions.kurtosis.t004": "met",
"db.functions.kurtosis.t005": "met",
"db.functions.kurtosis.t006": "met",
"db.functions.kurtosis.t007": "met",
"db.functions.lag.t001": "met",
"db.functions.lag.t002": "met",
"db.functions.lag.t003": "met",
Expand Down Expand Up @@ -10395,20 +10413,26 @@
"db.functions.regr-intercept.t005": "met",
"db.functions.regr-intercept.t006": "met",
"db.functions.regr-intercept.t007": "met",
"db.functions.regr-intercept.t008": "met",
"db.functions.regr-intercept.t009": "met",
"db.functions.regr-r2.t001": "met",
"db.functions.regr-r2.t002": "met",
"db.functions.regr-r2.t003": "met",
"db.functions.regr-r2.t004": "met",
"db.functions.regr-r2.t005": "met",
"db.functions.regr-r2.t006": "met",
"db.functions.regr-r2.t007": "met",
"db.functions.regr-r2.t008": "met",
"db.functions.regr-r2.t009": "met",
"db.functions.regr-slope.t001": "met",
"db.functions.regr-slope.t002": "met",
"db.functions.regr-slope.t003": "met",
"db.functions.regr-slope.t004": "met",
"db.functions.regr-slope.t005": "met",
"db.functions.regr-slope.t006": "met",
"db.functions.regr-slope.t007": "met",
"db.functions.regr-slope.t008": "met",
"db.functions.regr-slope.t009": "met",
"db.functions.regr-sxx.t001": "met",
"db.functions.regr-sxx.t002": "met",
"db.functions.regr-sxx.t003": "met",
Expand Down Expand Up @@ -10623,6 +10647,8 @@
"db.functions.skewness.t003": "met",
"db.functions.skewness.t004": "met",
"db.functions.skewness.t005": "met",
"db.functions.skewness.t006": "met",
"db.functions.skewness.t007": "met",
"db.functions.slashsign.t001": "met",
"db.functions.slashsign.t002": "met",
"db.functions.slashsign.t003": "met",
Expand Down
2 changes: 1 addition & 1 deletion crates/sqlbabel-policy/policy-databricks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ constructs = ["fn:VAR_POP", "fn:SKEWNESS", "fn:KURTOSIS", "fn:COVAR_POP", "fn:CO
replay = "warn"
default = "allow"
failure = "value"
reason = "VAR_POP, SKEWNESS, KURTOSIS, COVAR_POP, COVAR_SAMP, CORR and the REGR_ statistics other than REGR_COUNT, REGR_AVGX and REGR_AVGY update a running count, means and central moments or co-moments row by row in DOUBLE, as Spark's CentralMomentAgg, Covariance and PearsonCorrelation do. The converted SQL repeats that arithmetic exactly in the order DuckDB collects the rows, so its result is one Databricks itself returns for some order of the same rows: within Databricks's own row-order variation, which reaches the last digits, and further where the values share a large mean and vary little."
reason = "VAR_POP, SKEWNESS, KURTOSIS, COVAR_POP, COVAR_SAMP, CORR and the REGR_ statistics other than REGR_COUNT, REGR_AVGX and REGR_AVGY update a running count, means and central moments or co-moments row by row in DOUBLE, as Spark's CentralMomentAgg, Covariance and PearsonCorrelation do. The converted SQL repeats that arithmetic exactly in the order DuckDB collects the rows, so its result is one Databricks itself returns for some order of the same rows. Databricks's own result varies with that order and also with how the rows are split into partitions, whose partial counts, means and moments Spark merges in no fixed order. The variation reaches the last digits, and goes further where the values share a large mean and vary little."

# VAR_SAMP, STDDEV_SAMP, STDDEV_POP and their aliases VARIANCE, STDDEV and STD: the converted SQL
# computes them in two passes over the rows DuckDB collects, the mean, then the sum of squared
Expand Down
4 changes: 2 additions & 2 deletions evidence.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ commit = "8fa4e1c4bbb26244cc79db482ce162ed6d425826"
content_sha256 = "8525473a489f5b41e5d8690c333668a743c811bb9bd5666d454cf50fc6b4943e"

[pins.databricks]
commit = "25a15649341992dee2bf4fc5869da19d2719e4cd"
content_sha256 = "3317ff754b559991432a0be8c8f6ae7190d7ce26b5a29b0c83514dd69b36ae67"
commit = "587e0f42c106615891b2dcc1e9dc4de9abe756fd"
content_sha256 = "e97013645ff397e5f575cc248baa6e64c5e4e59d2783c7ae8b129c71f0cd53d0"

[pins.duckdb]
commit = "fa4ccd4dc55cb2d1fb2d37236c35b8b755045001"
Expand Down
Loading