HyukjinKwon commented on code in PR #43313:
URL: https://github.com/apache/spark/pull/43313#discussion_r1360284557
##########
connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/SparkConnectClient.scala:
##########
@@ -585,6 +587,27 @@ object SparkConnectClient {
def build(): SparkConnectClient = _configuration.toSparkConnectClient
}
+ /**
+ * Appends the Spark, Scala & JVM version, and the used OS to the
user-provided user agent.
+ */
+ private def genUserAgent(value: String): String = {
+ val scalaVersion = Properties.versionNumberString
+ val jvmVersion = System.getProperty("java.version").split("_")(0)
+ val osName = {
+ val os = System.getProperty("os.name").toLowerCase(Locale.ROOT)
+ if (os.contains("mac")) "darwin"
+ else if (os.contains("linux")) "linux"
+ else if (os.contains("win")) "windows"
+ else "unknown"
+ }
+ List(
+ value,
+ s"spark/$SPARK_VERSION",
+ s"scala/$scalaVersion",
+ s"jvm/$jvmVersion",
+ s"os/$osName").mkString(" ")
Review Comment:
Might not be a big deal but would be great to keep them same if it's easy to
make it consistent
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]