Skip to content

Commit 64a1c18

Browse files
authored
feat: Add backtrace feature to simplify enabling native backtraces in CometNativeException (#2515)
1 parent 25745a5 commit 64a1c18

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

docs/source/contributor-guide/debugging.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ Detecting the debugger
101101

102102
## Verbose debug
103103

104-
### Exception details
104+
### Enabling Native Backtraces
105105

106-
By default, Comet outputs the exception details specific for Comet.
106+
By default, Comet does not show native backtraces when exceptions happen in native code:
107107

108108
```scala
109109
scala> spark.sql("my_failing_query").show(false)
@@ -118,16 +118,15 @@ This was likely caused by a bug in DataFusion's code and we would welcome that y
118118

119119
```
120120

121-
There is a verbose exception option by leveraging DataFusion [backtraces](https://arrow.apache.org/datafusion/user-guide/example-usage.html#enable-backtraces)
122-
This option allows to append native DataFusion stack trace to the original error message.
123-
To enable this option with Comet it is needed to include `backtrace` feature in [Cargo.toml](https://github.com/apache/arrow-datafusion-comet/blob/main/core/Cargo.toml) for DataFusion dependencies
121+
Comet can be built with DataFusion's [backtrace] feature enabled, which will include native back traces in `CometNativeException`.
124122

125-
```toml
126-
datafusion-common = { version = "36.0.0", features = ["backtrace"] }
127-
datafusion = { default-features = false, version = "36.0.0", features = ["unicode_expressions", "backtrace"] }
128-
```
123+
[backtrace]: https://arrow.apache.org/datafusion/user-guide/example-usage.html#enable-backtraces
124+
125+
To build Comet with this feature enabled:
129126

130-
Then build the Comet as [described](https://github.com/apache/arrow-datafusion-comet/blob/main/README.md#getting-started)
127+
```shell
128+
make release COMET_FEATURES=backtrace
129+
```
131130

132131
Start Comet with `RUST_BACKTRACE=1`
133132

native/core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ hex = "0.4.3"
9494
datafusion-functions-nested = { version = "50.0.0" }
9595

9696
[features]
97+
backtrace = ["datafusion/backtrace"]
9798
default = []
9899
hdfs = ["datafusion-comet-objectstore-hdfs"]
99100
hdfs-opendal = ["opendal", "object_store_opendal", "hdfs-sys"]

0 commit comments

Comments
 (0)