Skip to content

Commit b01c168

Browse files
authored
docs: update the user guide for the 1.1.0 release (#6168)
* docs: update the user guide for the 1.1.0 release Sweep of the user guide against everything merged since 1.0.0 branched (af534e0), per the release preparation step in the release process. Correct statements that no longer match the code: the CI coverage table (only Spark 4.1 is gated before merge since the non-default profiles moved to the nightly run), the Spark 3.x Parquet limitations Comet has long since closed, cast/JSON/regex/array notes that say "falls back" where Comet now routes through the codegen dispatcher, S3 region auto-detection, Iceberg NOT IN pushdown, tokio thread defaults, shuffle and scan metric names, and a Kubernetes example that pointed at a Java 11 / Spark 3.5 image and left Comet disabled for lack of off-heap memory. Remove known-divergence entries that 1.1.0 fixed (boolean to decimal cast, explicit positive timestamp years, the ABFS object store cache key, most of the ANSI error-message items), and document new 1.1.0 behaviour: the experimental in-memory cache, the native Iceberg writer and the WRITE credential access mode, nested hash shuffle keys, BINARY sort-merge join keys, aggregate spill and memory metrics, native TIME functions, Variant-bearing tables whose Variant columns are not read, and the missing expression and plan-node rows. Add an "Upgrading to Comet 1.1.0" section to the upgrade guide, and drop the release-process notes about tag pushes publishing a Docker image, since that workflow was removed in #4241. * docs: address review feedback on the 1.1.0 user guide Document the Kryo registrator under "Additional Configuration" in the installation guide. Native broadcast needs it with spark.kryo.registrationRequired=true whether or not the in-memory cache is enabled, so link to it from the cache docs rather than describing it as a cache-only setting. Point the operator compatibility cache section and the operators table at the in-memory cache page that landed on main, instead of repeating it, which also drops a stale storage-format claim. List every source Comet checks for the Iceberg S3 region, and link the ANSI integral overflow divergence to #6217.
1 parent 0970351 commit b01c168

26 files changed

Lines changed: 350 additions & 265 deletions

‎docs/source/contributor-guide/release_process.md‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,6 @@ git tag 0.13.0-rc1
287287
git push apache 0.13.0-rc1
288288
```
289289

290-
Note that pushing a release candidate tag will trigger a GitHub workflow that will build a Docker image and publish
291-
it to GitHub Container Registry at https://github.com/apache/datafusion-comet/pkgs/container/datafusion-comet
292-
293290
### Publishing Documentation
294291

295292
In `docs` directory:
@@ -468,9 +465,6 @@ git tag 0.13.0
468465
git push apache 0.13.0
469466
```
470467

471-
Note that pushing a release tag will trigger a GitHub workflow that will build a Docker image and publish
472-
it to GitHub Container Registry at https://github.com/apache/datafusion-comet/pkgs/container/datafusion-comet
473-
474468
Reply to the vote thread to close the vote and announce the release. The announcement email should include:
475469

476470
- The release version

‎docs/source/user-guide/latest/compatibility/expressions/_category_template/cast.md‎

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,23 @@ under the License.
2222
Cast operations in Comet fall into three levels of support:
2323

2424
- **C (Compatible)**: The results match Apache Spark
25-
- **I (Incompatible)**: The results may match Apache Spark for some inputs, but there are known issues where some inputs
26-
will result in incorrect results or exceptions. The query stage will fall back to Spark by default. Setting
27-
`spark.comet.expression.Cast.allowIncompatible=true` will allow all incompatible casts to run natively in Comet, but this is not
28-
recommended for production use.
29-
- **U (Unsupported)**: Comet does not provide a native version of this cast expression and the query stage will fall back to
30-
Spark.
25+
- **I (Incompatible)**: Comet's native cast may produce different results from Apache Spark for some inputs. By
26+
default, Comet instead runs Spark's own code-generated cast inside the Comet pipeline, so the results match Spark.
27+
Setting `spark.comet.expression.Cast.allowIncompatible=true` selects the native cast, but this is not recommended
28+
for production use.
29+
- **U (Unsupported)**: Comet does not provide a native version of this cast, so it runs Spark's own code-generated
30+
cast inside the Comet pipeline.
3131
- **N/A**: Spark does not support this cast.
3232

33-
## ANSI Mode Fallback
33+
Incompatible and unsupported casts fall back to Spark only when Comet's codegen dispatcher cannot handle them (for
34+
example, casts involving `VariantType`) or when `spark.comet.exec.scalaUDF.codegen.enabled=false`.
3435

35-
Cast will fall back to Spark in some cases when ANSI mode is enabled. This can be enabled by setting `spark.comet.expression.Cast.allowIncompatible=true`. See the [Comet Supported Expressions Guide](../../../expressions.md) for more information on this configuration setting.
36+
## ANSI Mode Support
37+
38+
Enabling ANSI mode does not by itself make a cast fall back to Spark or require
39+
`spark.comet.expression.Cast.allowIncompatible=true`: every cast that Spark permits in ANSI mode has the same support
40+
level as in legacy mode. See the [ANSI Mode](#ansi-mode) table below for per-pair support, and the
41+
[Comet Supported Expressions Guide](../../../expressions.md) for more information on the `allowIncompatible` setting.
3642

3743
## Whitespace Trimming in Casts from String
3844

@@ -143,20 +149,12 @@ Comet's native `CAST(date AS STRING)` is compatible with Spark. Years below 1000
143149
zero-padded to four digits (e.g. year 999 renders as `0999-01-01`). Years above 9999 are
144150
rendered without truncation. The cast is timezone-independent.
145151

146-
## String to TimestampNTZ
147-
148-
Comet's native `CAST(string AS TIMESTAMP_NTZ)` implementation matches Apache Spark's behavior.
149-
Unlike `CAST(string AS TIMESTAMP)`, this cast is timezone-independent: any timezone offset in
150-
the input string (e.g. `+08:00`, `Z`, `UTC`) is silently discarded, and the local date-time
151-
components are preserved as-is. Time-only strings (e.g. `T12:34:56`, `12:34`) produce `NULL`.
152-
The result is always a wall-clock timestamp with no timezone conversion or DST adjustment.
153-
154152
## Decimal with Negative Scale to String
155153

156154
Casting a `DecimalType` with a negative scale to `StringType` is marked as incompatible when
157155
`spark.sql.legacy.allowNegativeScaleOfDecimal` is `false` (the default). When that config is
158-
disabled, Spark cannot create negative-scale decimals, so Comet falls back to avoid running
159-
native execution on unexpected inputs.
156+
disabled, Spark cannot create negative-scale decimals, so by default Comet runs Spark's
157+
code-generated cast instead of the native one.
160158

161159
When `spark.sql.legacy.allowNegativeScaleOfDecimal=true`, the cast is compatible. Comet matches
162160
Spark's behavior of using Java `BigDecimal.toString()` semantics, which produces scientific

‎docs/source/user-guide/latest/compatibility/expressions/_category_template/map.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ keys, in `try_element_at`, and in other contexts where map ordering must be dete
2626
runs `MapSort` natively, so map shuffle and group-by-on-map stay on Comet under Spark 4.0.
2727

2828
When `spark.comet.exec.strictFloatingPoint=true`, `MapSort` falls back to Spark for maps whose
29-
keys contain `Float` or `Double` (consistent with `SortOrder` and `SortArray`). Arrow's sort uses
29+
keys contain `Float` or `Double`. Arrow's sort uses
3030
IEEE total ordering for floating-point, which differs from Spark's `Double.compare` semantics for
3131
`NaN` and `-0.0`.
3232

‎docs/source/user-guide/latest/compatibility/expressions/index.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ Spark 4.0 <spark-4.0/index>
3232
Spark 4.1 <spark-4.1/index>
3333
```
3434

35+
Spark 3.4 support is deprecated and will be removed in a future release; see
36+
[Spark Version Compatibility](../spark-versions.md#spark-34).
37+
3538
Expressions that are not 100% Spark-compatible fall back to Spark by default, except those
3639
with a JVM codegen-dispatch path, which stay in Comet's native pipeline and match Spark
3740
exactly. Set `spark.comet.expression.EXPRNAME.allowIncompatible=true`, where `EXPRNAME` is

‎docs/source/user-guide/latest/compatibility/expressions/spark-3.4/index.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ expression class name, to run Comet's native implementation despite its differen
2727
from Spark. See the [Comet Supported Expressions Guide](../../../expressions.md)
2828
for more information on this configuration setting.
2929

30+
Spark 3.4 support is deprecated and will be removed in a future release; see
31+
[Spark Version Compatibility](../../spark-versions.md#spark-34).
32+
3033
```{toctree}
3134
:maxdepth: 1
3235

‎docs/source/user-guide/latest/compatibility/index.md‎

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ which document their per-expression configs and the specific differences to expe
6868

6969
This is distinct from expressions that have **no** codegen-dispatch path: there, the
7070
incompatible cases fall back to Spark by default, and `allowIncompatible=true` runs the native
71-
(incompatible) path instead. `cast` is the main example; see the
71+
(incompatible) path instead. Aggregate functions such as `mode` are the main example, because the
72+
codegen dispatcher covers only scalar expressions; see the
7273
[expression reference](../expressions.md) for which expressions have incompatible cases.
7374

7475
## Strings with non-UTF-8 bytes
@@ -111,12 +112,10 @@ Code that catches `SparkException` and only asserts on message substrings is una
111112
inspects the exception class, `getCondition()`, or the parameterised error class will observe
112113
divergence:
113114

114-
- Byte / Short `Add`, `Subtract`, and `Multiply` overflow raises `ARITHMETIC_OVERFLOW` where Spark
115-
4.1 raises `BINARY_ARITHMETIC_OVERFLOW`, and Long overflow surfaces as `"integer overflow"`
116-
rather than `"long overflow"`. `Abs` uses Rust type names (`Int8`, `Int64`, ...) in the message
117-
instead of Spark's SQL type names, and the scalar path of `UnaryMinus` on Byte / Short emits a
118-
malformed message. The `try_` suggestion is omitted from all of these
119-
([#5071](https://github.com/apache/datafusion-comet/issues/5071)).
115+
- Byte / Short `Add`, `Subtract`, and `Multiply` overflow raises `ARITHMETIC_OVERFLOW` (for
116+
example `byte overflow`) where Spark raises `BINARY_ARITHMETIC_OVERFLOW`, and integral
117+
`ARITHMETIC_OVERFLOW` messages omit Spark's `try_` suggestion
118+
([#6217](https://github.com/apache/datafusion-comet/issues/6217)).
120119
- Wide-decimal arithmetic overflow, decimal divide-by-zero, and decimal-to-decimal cast overflow
121120
raise raw Arrow errors that bypass `SparkErrorConverter` and surface as `CometNativeException`
122121
rather than `SparkArithmeticException` with the proper error class and query context
@@ -130,18 +129,11 @@ The following native paths silently return values that differ from Spark for edg
130129
Most also have entries in the per-category expression pages linked above; they are collected here
131130
so users hunting an unexpected value have a single place to check:
132131

133-
- `CAST(boolean AS DECIMAL(p, s))` where `10^s` exceeds the target precision (e.g.
134-
`DECIMAL(1, 1)`) throws `NUMERIC_VALUE_OUT_OF_RANGE` regardless of the eval mode. Spark returns
135-
`NULL` under legacy and try mode, and only throws under ANSI
136-
([#5068](https://github.com/apache/datafusion-comet/issues/5068)).
137132
- `CAST(string AS timestamp)` and `CAST(string AS timestamp_ntz)` trim Unicode whitespace.
138133
Spark trims only the bytes `0x00`-`0x20` and `0x7F`, so a value padded with an ASCII control byte
139134
parses in Spark and returns `NULL` in Comet, while a value padded with non-ASCII whitespace such
140135
as `U+3000` returns `NULL` in Spark and parses in Comet
141136
([#5149](https://github.com/apache/datafusion-comet/issues/5149)).
142-
- **Explicit positive timestamp years:** Spark accepts strings such as `+7528` as the start
143-
of that year, while Comet's native string-to-timestamp cast returns NULL in non-ANSI mode
144-
([#5716](https://github.com/apache/datafusion-comet/issues/5716)).
145137
- Native `RANGE` window frames with an explicit `PRECEDING` / `FOLLOWING` offset diverge from
146138
Spark when the boundary arithmetic overflows for `DATE` or `DECIMAL` `ORDER BY` columns
147139
([#5022](https://github.com/apache/datafusion-comet/issues/5022)).
@@ -156,13 +148,3 @@ so users hunting an unexpected value have a single place to check:
156148
`spark.sql.codegen.fallback` or when the generated code exceeds
157149
`spark.sql.codegen.hugeMethodLimit`, where an intermediate overflow that later cancels out
158150
returns `NULL` (or raises under ANSI) in Spark but the recovered value in Comet.
159-
160-
## Object store cache
161-
162-
When Comet's native scan reads Parquet files, it caches one object store instance per
163-
`(scheme + host + port, hadoop-config-hash)` key. For `abfss://container@account.dfs.core.windows.net/...`
164-
URLs, the container lives in the URL userinfo, not the host, so two containers in one storage
165-
account currently collide on the same cache entry. Within a single executor process, reading from
166-
a second container after a first can be served by the first container's store instance and return
167-
its data. S3, GCS, and HDFS are unaffected because their bucket / host lives in the URL host
168-
component. Tracked by [#4993](https://github.com/apache/datafusion-comet/issues/4993).

‎docs/source/user-guide/latest/compatibility/operators.md‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ operator restrictions and aggregate buffer compatibility checks still apply.
3232
Parquet writes whose input plans contain an empty relation use Spark's writer to preserve
3333
readable empty output files and their schema metadata.
3434

35+
## In-Memory Cache
36+
37+
Comet can store cached relations (`df.cache()`, `CACHE TABLE`) in Arrow format and scan them
38+
natively. This is experimental and disabled by default; see [In-Memory Cache](../in-memory-cache.md)
39+
for how to enable it. Comet does not replace a `spark.sql.cache.serializer` that the application
40+
has already set. Relations whose schema Comet's Arrow writer does not support are cached in
41+
Spark's default format, and their scans fall back to Spark. Reads that feed Spark operators rather
42+
than Comet operators can be slower than Spark's cache.
43+
44+
With Kryo and `spark.kryo.registrationRequired=true`, Comet needs its Kryo registrator whether or
45+
not the cache is enabled; see [Kryo serialization](../installation.md#kryo-serialization).
46+
3547
## Sampling
3648

3749
Comet runs `SampleExec` natively when sampling is performed without replacement, which covers
@@ -95,8 +107,11 @@ runs natively; it is controlled by `spark.comet.exec.windowGroupLimit.enabled` (
95107

96108
**Known incompatibilities:**
97109

98-
- Signed-zero ordering (`-0.0` vs `+0.0`) diverges from Spark's `RankLimitIterator`; see
99-
[floating-point ordering](./floating-point.md#ordering-signed-zero-00-vs-00).
110+
- Floating-point values nested in array or struct `ORDER BY` keys are compared with Arrow's raw
111+
total ordering, so ranks can differ from Spark when the data mixes `-0.0` and `+0.0` or more
112+
than one NaN representation ([#5507](https://github.com/apache/datafusion-comet/issues/5507)).
113+
Scalar `FLOAT` and `DOUBLE` keys are normalized and match Spark; see
114+
[floating-point ordering](./floating-point.md).
100115

101116
## Round-Robin Partitioning
102117

‎docs/source/user-guide/latest/compatibility/scans.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ The following features are not supported and cause Comet to fall back to Spark:
4848
does not replicate. By default Comet falls back to Spark in this case. Set
4949
`spark.comet.scan.allowDisabledParquetVectorizedReader=true` to opt in to running the
5050
Comet Parquet scan regardless.
51+
- A read schema that repeats a Parquet field id, at the top level or within a struct, when
52+
`spark.sql.parquet.fieldId.read.enabled=true`.
5153

5254
The following limitation may produce incorrect results without falling back to Spark:
5355

‎docs/source/user-guide/latest/compatibility/spark-versions.md‎

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,40 +33,32 @@ Spark 3.4.3 is supported with Java 17 and Scala 2.12/2.13.
3333
```{warning}
3434
Spark 3.4 support is deprecated as of the 1.0.0 release and will be removed in a future release.
3535
Comet continues to build and publish Spark 3.4 binaries in the meantime, but Apache Spark's own
36-
SQL test suite is no longer run against Spark 3.4 on every change: it runs only when a contributor
36+
SQL test suite no longer runs against Spark 3.4 automatically: it runs only when a contributor
3737
opts a pull request into it. Regressions specific to Spark 3.4 are therefore more likely to reach a
3838
release than on the other supported versions. We recommend moving to Spark 3.5 or later.
3939
```
4040

4141
### Known Limitations
4242

43-
- **Reading `TimestampLTZ` as `TimestampNTZ`**: Spark 3.4 raises an error for this operation
44-
(SPARK-36182), but Comet's Parquet scan silently returns the raw UTC value instead.
45-
See [Parquet Compatibility](scans.md#parquet-scan-limitations) for details.
46-
47-
- **Unsupported Parquet type conversions**: Spark 3.4 raises schema incompatibility errors for
48-
certain type mismatches (e.g., reading INT32 as BIGINT, decimal precision changes), but Comet's
49-
Comet's Parquet scan may not detect these and could return unexpected values.
50-
See [Parquet Compatibility](scans.md#parquet-scan-limitations) for details.
43+
- **Extra `SparkException` layer in Parquet schema mismatch errors**: when a Parquet read is
44+
rejected because a file's type cannot be converted to the requested type, the error's cause chain
45+
has one more `SparkException` layer than Spark's own reader produces.
46+
See [Parquet Compatibility](scans.md#schema-mismatch-handling) for details.
5147

5248
## Spark 3.5
5349

5450
Spark 3.5.9 is supported with Java 17 and Scala 2.12/2.13.
5551

5652
### Known Limitations
5753

58-
- **Reading `TimestampLTZ` as `TimestampNTZ`**: Spark 3.5 raises an error for this operation
59-
(SPARK-36182), but Comet's Parquet scan silently returns the raw UTC value instead.
60-
See [Parquet Compatibility](scans.md#parquet-scan-limitations) for details.
61-
62-
- **Unsupported Parquet type conversions**: Spark 3.5 raises schema incompatibility errors for
63-
certain type mismatches (e.g., reading INT32 as BIGINT, decimal precision changes), but Comet's
64-
Comet's Parquet scan may not detect these and could return unexpected values.
65-
See [Parquet Compatibility](scans.md#parquet-scan-limitations) for details.
54+
- **Extra `SparkException` layer in Parquet schema mismatch errors**: when a Parquet read is
55+
rejected because a file's type cannot be converted to the requested type, the error's cause chain
56+
has one more `SparkException` layer than Spark's own reader produces.
57+
See [Parquet Compatibility](scans.md#schema-mismatch-handling) for details.
6658

6759
## Spark 4.0
6860

69-
Spark 4.0.4 is supported with Java 17 and Scala 2.13.
61+
Spark 4.0.4 is supported with Java 17/21 and Scala 2.13.
7062

7163
### Known Limitations
7264

@@ -93,6 +85,7 @@ Spark 4.1.3 is supported with Java 17/21 and Scala 2.13.
9385
Spark 4.2.0 is provided as experimental support with Java 17 and Scala 2.13.
9486

9587
```{warning}
96-
Spark 4.2 support is experimental. Comet tests run in CI for this version, but the Spark SQL tests
97-
do not yet. It is intended for early evaluation only and should not be used in production.
88+
Spark 4.2 support is experimental. Comet's own test suites run nightly for this version, but
89+
Apache Spark's SQL test suite does not run against it yet. It is intended for early evaluation only
90+
and should not be used in production.
9891
```

‎docs/source/user-guide/latest/datasources.md‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ Arrow format, allowing the Comet pipeline to take over after that, but the proce
2929

3030
### Apache Iceberg
3131

32-
Comet accelerates Iceberg scans of Parquet files. See the [Iceberg Guide] for more information.
32+
Comet accelerates Iceberg scans of Parquet files and has an experimental, opt-in native Iceberg writer.
33+
See the [Iceberg Guide] and [Iceberg Writes](iceberg-writes.md) for more information.
3334

3435
[Iceberg Guide]: iceberg.md
3536

3637
### CSV
3738

3839
Comet provides experimental Rust-based CSV scan support. When `spark.comet.scan.csv.v2.enabled` is enabled, CSV files
3940
are read in Rust for improved performance. This feature is experimental and performance benefits are
40-
workload-dependent.
41+
workload-dependent. Only Spark's DataSource V2 CSV scan is accelerated, and Spark reads CSV through the V1 API by
42+
default, so also remove `csv` from `spark.sql.sources.useV1SourceList`.
4143

4244
Alternatively, when `spark.comet.convert.csv.enabled` is enabled, data from Spark's CSV reader is immediately
4345
converted into Arrow format, allowing the Comet pipeline to take over after that.
@@ -308,6 +310,10 @@ credential providers and options documented above also apply to alias-scheme URL
308310
translation feeds the native Iceberg scan; see
309311
[Object store configuration (S3)](iceberg.md#object-store-configuration-s3) in the Iceberg guide.
310312

313+
A native Parquet scan whose alias-scheme paths span more than one bucket falls back to Spark. Alias
314+
schemes apply to native scans only: a native Iceberg write to an alias-scheme location falls back to
315+
iceberg-java.
316+
311317
### Examples
312318

313319
The following examples demonstrate how to configure S3 access using different authentication methods.
@@ -344,7 +350,7 @@ Comet's S3 support has the following limitations:
344350

345351
1. **Partial Hadoop S3A configuration support**: Not all Hadoop S3A configurations are currently supported. Only the configurations listed in the tables above are translated and applied to the underlying `object_store` crate.
346352

347-
2. **Custom credential providers**: Custom implementations of AWS credential providers are not supported. The implementation only supports the standard credential providers listed in the table above. We are planning to add support for custom credential providers through a JNI-based adapter that will allow calling Java credential providers from Rust code. See [#1829](https://github.com/apache/datafusion-comet/issues/1829) for more details.
353+
2. **Custom credential providers**: Custom credential provider classes named in `fs.s3a.aws.credentials.provider` are not supported; only the standard providers listed in the table above are. To route credential requests through your own Java code, implement Comet's `CometS3CredentialProvider` SPI; see [S3 Credential Providers](s3-credential-providers.md). Broader Hadoop S3A integration is tracked in [#1829](https://github.com/apache/datafusion-comet/issues/1829).
348354

349355
## Azure
350356

0 commit comments

Comments
 (0)