Skip to content

Commit 63cfb1d

Browse files
authored
docs: Update configuration guide to show optional configs (#1524)
1 parent 30093e3 commit 63cfb1d

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

common/src/main/scala/org/apache/comet/CometConf.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ object CometConf extends ShimCometConf {
5454
/** List of all configs that is used for generating documentation */
5555
val allConfs = new ListBuffer[ConfigEntry[_]]
5656

57-
def register(conf: ConfigEntryWithDefault[_]): Unit = {
57+
def register(conf: ConfigEntry[_]): Unit = {
5858
allConfs.append(conf)
5959
}
6060

@@ -746,13 +746,15 @@ private class TypedConfigBuilder[T](
746746

747747
/** Creates a [[ConfigEntry]] that does not have a default value. */
748748
def createOptional: OptionalConfigEntry[T] = {
749-
new OptionalConfigEntry[T](
749+
val conf = new OptionalConfigEntry[T](
750750
parent.key,
751751
converter,
752752
stringConverter,
753753
parent._doc,
754754
parent._public,
755755
parent._version)
756+
CometConf.register(conf)
757+
conf
756758
}
757759

758760
/** Creates a [[ConfigEntry]] that has a default value. */

docs/source/user-guide/configs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Comet provides the following configuration settings.
7373
| spark.comet.expression.allowIncompatible | Comet is not currently fully compatible with Spark for all expressions. Set this config to true to allow them anyway. For more information, refer to the Comet Compatibility Guide (https://datafusion.apache.org/comet/user-guide/compatibility.html). | false |
7474
| spark.comet.memory.overhead.factor | Fraction of executor memory to be allocated as additional non-heap memory per executor process for Comet. | 0.2 |
7575
| spark.comet.memory.overhead.min | Minimum amount of additional memory to be allocated per executor process for Comet, in MiB. | 402653184b |
76+
| spark.comet.memoryOverhead | The amount of additional memory to be allocated per executor process for Comet, in MiB. This config is optional. If this is not specified, it will be set to `spark.comet.memory.overhead.factor` * `spark.executor.memory`. This is memory that accounts for things like Comet native execution, Comet shuffle, etc. | |
7677
| spark.comet.metrics.updateInterval | The interval in milliseconds to update metrics. If interval is negative, metrics will be updated upon task completion. | 3000 |
7778
| spark.comet.nativeLoadRequired | Whether to require Comet native library to load successfully when Comet is enabled. If not, Comet will silently fallback to Spark when it fails to load the native lib. Otherwise, an error will be thrown and the Spark job will be aborted. | false |
7879
| spark.comet.parquet.enable.directBuffer | Whether to use Java direct byte buffer when reading Parquet. | false |

spark/src/main/scala/org/apache/comet/GenerateDocs.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ object GenerateDocs {
5050
w.write("| Config | Description | Default Value |\n".getBytes)
5151
w.write("|--------|-------------|---------------|\n".getBytes)
5252
for (conf <- confs) {
53-
w.write(s"| ${conf.key} | ${conf.doc.trim} | ${conf.defaultValueString} |\n".getBytes)
53+
if (conf.defaultValue.isEmpty) {
54+
w.write(s"| ${conf.key} | ${conf.doc.trim} | |\n".getBytes)
55+
} else {
56+
w.write(s"| ${conf.key} | ${conf.doc.trim} | ${conf.defaultValueString} |\n".getBytes)
57+
}
5458
}
5559
} else {
5660
w.write(s"${line.trim}\n".getBytes)

0 commit comments

Comments
 (0)