From 5a751027f57bcf4cab3d3d59fb990e37e34473e0 Mon Sep 17 00:00:00 2001 From: Bowen Liang Date: Fri, 22 Dec 2023 17:27:40 +0800 Subject: [PATCH] [KYUUBI #5905] [DOC] Workaround for long inlined code sample in config page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # :mag: Description ## Issue References ๐Ÿ”— ## Describe Your Solution ๐Ÿ”ง Workaround to fix the display issue of long inlined code sample on config page. ## Types of changes :bookmark: - [ ] Bugfix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan ๐Ÿงช #### Behavior Without This Pull Request :coffin: ![image](https://github.com/apache/kyuubi/assets/1935105/7910808d-7235-4d21-bdc5-84260af53e80) #### Behavior With This Pull Request :tada: ![image](https://github.com/apache/kyuubi/assets/1935105/877f45a5-c49b-45fc-90a1-3c23eb2aa508) #### Related Unit Tests --- # Checklists ## ๐Ÿ“ Author Self Checklist - [x] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project - [x] I have performed a self-review - [ ] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) ## ๐Ÿ“ Committer Pre-Merge Checklist - [x] Pull request title is okay. - [x] No license issues. - [x] Milestone correctly set? - [ ] Test coverage is ok - [x] Assignees are selected. - [x] Minimum number of approvals - [x] No changes are requested **Be nice. Be informative.** Closes #5905 from bowenliang123/doc-block. Closes #5905 b4d28ed85 [Bowen Liang] update 7aa995b38 [Bowen Liang] update ef947ea15 [Bowen Liang] update 7b3263bee [Bowen Liang] update aefd206ae [Bowen Liang] update f02ec3acf [Bowen Liang] update d3302d55c [Bowen Liang] fix display by putting url demo in code block Authored-by: Bowen Liang Signed-off-by: Cheng Pan --- docs/configuration/settings.md | 18 ++++++++-- .../config/AllKyuubiConfiguration.scala | 35 +++++++++++-------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/docs/configuration/settings.md b/docs/configuration/settings.md index a1e0d5213..20a1bf8d9 100644 --- a/docs/configuration/settings.md +++ b/docs/configuration/settings.md @@ -518,7 +518,11 @@ Setting them in `$KYUUBI_HOME/conf/kyuubi-defaults.conf` supplies with default v ### Via JDBC Connection URL -Setting them in the JDBC Connection URL supplies session-specific for each SQL engine. For example: ```jdbc:hive2://localhost:10009/default;#spark.sql.shuffle.partitions=2;spark.executor.memory=5g``` +Setting them in the JDBC Connection URL supplies session-specific for each SQL engine. For example: + +``` +jdbc:hive2://localhost:10009/default;#spark.sql.shuffle.partitions=2;spark.executor.memory=5g +``` - **Runtime SQL Configuration** - For [Runtime SQL Configurations](https://spark.apache.org/docs/latest/configuration.html#runtime-sql-configuration), they will take affect every time @@ -550,7 +554,11 @@ The below options in `kyuubi-defaults.conf` will set `parallelism.default: 2` an ### Via JDBC Connection URL -Setting them in the JDBC Connection URL supplies session-specific for each SQL engine. For example: ```jdbc:hive2://localhost:10009/default;#flink.parallelism.default=2;flink.taskmanager.memory.process.size=5g``` +Setting them in the JDBC Connection URL supplies session-specific for each SQL engine. For example: + +``` +jdbc:hive2://localhost:10009/default;#flink.parallelism.default=2;flink.taskmanager.memory.process.size=5g +``` ### Via SET Statements @@ -577,7 +585,11 @@ The below options in `kyuubi-defaults.conf` will set `query_max_stage_count: 500 ### Via JDBC Connection URL -Setting them in the JDBC Connection URL supplies session-specific for each SQL engine. For example: ```jdbc:hive2://localhost:10009/default;#trino.query_max_stage_count=500;trino.parse_decimal_literals_as_double=true``` +Setting them in the JDBC Connection URL supplies session-specific for each SQL engine. For example: + +``` +jdbc:hive2://localhost:10009/default;#trino.query_max_stage_count=500;trino.parse_decimal_literals_as_double=true +``` ### Via SET Statements diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/config/AllKyuubiConfiguration.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/config/AllKyuubiConfiguration.scala index 7cb4c9002..75226a8b6 100644 --- a/kyuubi-server/src/test/scala/org/apache/kyuubi/config/AllKyuubiConfiguration.scala +++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/config/AllKyuubiConfiguration.scala @@ -125,12 +125,12 @@ class AllKyuubiConfiguration extends KyuubiFunSuite { | override all settings in `$SPARK_HOME/conf/spark-defaults.conf`""" += "### Via JDBC Connection URL" += """ Setting them in the JDBC Connection URL - | supplies session-specific for each SQL engine. For example: - | ``` - |jdbc:hive2://localhost:10009/default;# - |spark.sql.shuffle.partitions=2;spark.executor.memory=5g - |``` - |""" += + | supplies session-specific for each SQL engine. For example:""" ++= + // scalastyle:off + """``` + |jdbc:hive2://localhost:10009/default;#spark.sql.shuffle.partitions=2;spark.executor.memory=5g + |```""" += + // scalastyle:on "" += "- **Runtime SQL Configuration**" += """ - For [Runtime SQL Configurations]( @@ -168,11 +168,14 @@ class AllKyuubiConfiguration extends KyuubiFunSuite { |```""" += """The below options in `kyuubi-defaults.conf` will set `parallelism.default: 2` | and `taskmanager.memory.process.size: 5g` into flink configurations.""" += - "### Via JDBC Connection URL" += - """Setting them in the JDBC Connection URL supplies session-specific - | for each SQL engine. For example: ```jdbc:hive2://localhost:10009/default; - |#flink.parallelism.default=2;flink.taskmanager.memory.process.size=5g``` - |""" += + "### Via JDBC Connection URL" ++= + "Setting them in the JDBC Connection URL supplies session-specific for each SQL engine." + + " For example:" ++= + // scalastyle:off + """``` + | jdbc:hive2://localhost:10009/default;#flink.parallelism.default=2;flink.taskmanager.memory.process.size=5g + |```""" += + // scalastyle:on "### Via SET Statements" += """Please refer to the Flink official online documentation for [SET Statements] |(https://nightlies.apache.org/flink/flink-docs-stable/docs/dev/table/sql/set/)""" @@ -199,10 +202,14 @@ class AllKyuubiConfiguration extends KyuubiFunSuite { """The below options in `kyuubi-defaults.conf` will set `query_max_stage_count: 500` | and `parse_decimal_literals_as_double: true` into trino session properties.""" += "### Via JDBC Connection URL" += - """Setting them in the JDBC Connection URL supplies session-specific - | for each SQL engine. For example: ```jdbc:hive2://localhost:10009/default; - |#trino.query_max_stage_count=500;trino.parse_decimal_literals_as_double=true``` + "Setting them in the JDBC Connection URL supplies session-specific for each SQL engine." + + " For example:" ++= + // scalastyle:off + """ ``` + | jdbc:hive2://localhost:10009/default;#trino.query_max_stage_count=500;trino.parse_decimal_literals_as_double=true + | ``` |""" += + // scalastyle:on "### Via SET Statements" += """Please refer to the Trino official online documentation for [SET Statements] |(https://trino.io/docs/current/sql/set-session.html)"""