Skip to content

Commit c6136aa

Browse files
authored
fix: Fix generate-user-guide-reference-docs failure when mvn command is not executed at root (#2691)
1 parent 239fc1e commit c6136aa

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ and sorting on floating-point data can be enabled by setting `spark.comet.expres
5656
## Incompatible Expressions
5757

5858
Expressions that are not 100% Spark-compatible will fall back to Spark by default and can be enabled by setting
59-
`spark.comet.expression.EXPRNAME.allowIncompatible=true`, where `EXPRNAME` is the Spark expression class name. See
60-
the [Comet Supported Expressions Guide](expressions.md) for more information on this configuration setting.
59+
`spark.comet.expression.EXPRNAME.allowIncompatible=true`, where `EXPRNAME` is the Spark expression class name. See
60+
the [Comet Supported Expressions Guide](expressions.md) for more information on this configuration setting.
6161

6262
It is also possible to specify `spark.comet.expression.allowIncompatible=true` to enable all
6363
incompatible expressions.

spark/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ under the License.
326326
</goals>
327327
<configuration>
328328
<mainClass>org.apache.comet.GenerateDocs</mainClass>
329+
<arguments>${project.parent.basedir}/docs/source/user-guide/latest/</arguments>
329330
<classpathScope>compile</classpathScope>
330331
</configuration>
331332
</execution>

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,16 @@ import org.apache.comet.serde.{Compatible, Incompatible, QueryPlanSerde}
3636
*/
3737
object GenerateDocs {
3838

39-
private def userGuideLocation = "docs/source/user-guide/latest/"
40-
41-
val publicConfigs: Set[ConfigEntry[_]] = CometConf.allConfs.filter(_.isPublic).toSet
39+
private val publicConfigs: Set[ConfigEntry[_]] = CometConf.allConfs.filter(_.isPublic).toSet
4240

4341
def main(args: Array[String]): Unit = {
44-
generateConfigReference()
45-
generateCompatibilityGuide()
42+
val userGuideLocation = args(0)
43+
generateConfigReference(s"$userGuideLocation/configs.md")
44+
generateCompatibilityGuide(s"$userGuideLocation/compatibility.md")
4645
}
4746

48-
private def generateConfigReference(): Unit = {
47+
private def generateConfigReference(filename: String): Unit = {
4948
val pattern = "<!--BEGIN:CONFIG_TABLE\\[(.*)]-->".r
50-
val filename = s"$userGuideLocation/configs.md"
5149
val lines = readFile(filename)
5250
val w = new BufferedOutputStream(new FileOutputStream(filename))
5351
for (line <- lines) {
@@ -95,8 +93,7 @@ object GenerateDocs {
9593
w.close()
9694
}
9795

98-
private def generateCompatibilityGuide(): Unit = {
99-
val filename = s"$userGuideLocation/compatibility.md"
96+
private def generateCompatibilityGuide(filename: String): Unit = {
10097
val lines = readFile(filename)
10198
val w = new BufferedOutputStream(new FileOutputStream(filename))
10299
for (line <- lines) {

0 commit comments

Comments
 (0)