You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ul...@apache.org on 2021/08/30 08:55:11 UTC
[incubator-kyuubi] branch master updated: [KYUUBI #1000] Use
underscore instead hyphen in path
This is an automated email from the ASF dual-hosted git repository.
ulyssesyou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new 94d60ea [KYUUBI #1000] Use underscore instead hyphen in path
94d60ea is described below
commit 94d60ea505800bf61954f8d69ff772f569a83700
Author: hongdongdong <ho...@cmss.chinamobile.com>
AuthorDate: Mon Aug 30 16:55:03 2021 +0800
[KYUUBI #1000] Use underscore instead hyphen in path
<!--
Thanks for sending a pull request!
Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->
### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
1. If you add a feature, you can talk about the use case of it.
2. If you fix a bug, you can clarify why it is a bug.
-->
Use underscore instead hyphen in path, friendly to sql.
### _How was this patch tested?_
- [X] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request
Closes #1000 from hddong/fix-underscore.
Closes #1000
8b3459a5 [hongdongdong] Use underscore instead hyphen in path
Authored-by: hongdongdong <ho...@cmss.chinamobile.com>
Signed-off-by: ulysses-you <ul...@gmail.com>
---
.../apache/kyuubi/engine/spark/events/EventLoggingServiceSuite.scala | 2 +-
.../src/main/scala/org/apache/kyuubi/events/KyuubiEvent.scala | 2 +-
.../scala/org/apache/kyuubi/events/EventLoggingServiceSuite.scala | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/events/EventLoggingServiceSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/events/EventLoggingServiceSuite.scala
index 8d912a3..ae72b9d 100644
--- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/events/EventLoggingServiceSuite.scala
+++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/events/EventLoggingServiceSuite.scala
@@ -94,7 +94,7 @@ class EventLoggingServiceSuite extends WithSparkSQLEngine with JDBCTestUtils {
test("statementEvent: generate, dump and query") {
val statementEventPath = Paths.get(
- logRoot.toString, "spark-statement", s"day=$currentDate", engine.engineId + ".json")
+ logRoot.toString, "spark_statement", s"day=$currentDate", engine.engineId + ".json")
val sql = "select timestamp'2021-06-01'"
withSessionHandle { (client, handle) =>
diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/events/KyuubiEvent.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/events/KyuubiEvent.scala
index 39a59c5..24aa75b 100644
--- a/kyuubi-common/src/main/scala/org/apache/kyuubi/events/KyuubiEvent.scala
+++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/events/KyuubiEvent.scala
@@ -22,7 +22,7 @@ import java.util.Locale
trait KyuubiEvent extends Product {
final lazy val eventType: String = {
this.getClass.getSimpleName.stripSuffix("Event")
- .replaceAll("(.)([A-Z])", "$1-$2")
+ .replaceAll("(.)([A-Z])", "$1_$2")
.toLowerCase(Locale.ROOT)
}
diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/events/EventLoggingServiceSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/events/EventLoggingServiceSuite.scala
index b8ea732..c38e5e5 100644
--- a/kyuubi-server/src/test/scala/org/apache/kyuubi/events/EventLoggingServiceSuite.scala
+++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/events/EventLoggingServiceSuite.scala
@@ -43,9 +43,9 @@ class EventLoggingServiceSuite extends WithKyuubiServer with JDBCTestUtils {
test("statementEvent: generate, dump and query") {
val hostName = InetAddress.getLocalHost.getCanonicalHostName
val serverStatementEventPath =
- Paths.get(logRoot.toString, "kyuubi-statement", s"day=$currentDate", s"server-$hostName.json")
+ Paths.get(logRoot.toString, "kyuubi_statement", s"day=$currentDate", s"server-$hostName.json")
val engineStatementEventPath =
- Paths.get(logRoot.toString, "spark-statement", s"day=$currentDate", "*.json")
+ Paths.get(logRoot.toString, "spark_statement", s"day=$currentDate", "*.json")
val sql = "select timestamp'2021-06-01'"
withJdbcStatement() { statement =>