You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/08/15 03:21:44 UTC

[GitHub] [incubator-kyuubi] wForget commented on a diff in pull request #3227: SparkConfParser supports parse bytes and time

wForget commented on code in PR #3227:
URL: https://github.com/apache/incubator-kyuubi/pull/3227#discussion_r945402226


##########
extensions/spark/kyuubi-spark-connector-common/src/main/scala/org/apache/kyuubi/spark/connector/common/SparkConfParser.scala:
##########
@@ -59,11 +61,19 @@ case class SparkConfParser(
     override protected def conversion(value: String): String = value
   }
 
+  class BytesConfParser extends ConfParser[Long] {
+    override protected def conversion(value: String): Long = JavaUtils.byteStringAsBytes(value)
+  }
+
+  class TimeConfParser extends ConfParser[Long] {
+    override protected def conversion(value: String): Long = JavaUtils.timeStringAsMs(value)
+  }
+
   abstract class ConfParser[T]() {
     private var optionName: Option[String] = None
     private var sessionConfName: Option[String] = None
     private var tablePropertyName: Option[String] = None
-    private var defaultValue: Option[T] = None
+    private var defaultValue: Option[String] = None

Review Comment:
   Do we need to add another method for the default value of type string?
   like spark:
   ![3d06f5d6a8a08d05c612d30316eeddc](https://user-images.githubusercontent.com/17894939/184571502-beb854f1-e653-417f-855e-9fd336effbf5.jpg)
   



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org