You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/09/18 11:57:51 UTC
[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1126: [KYUUBI #1105][FOLLOWUP] Minor improve `ZorderBytesUtils.defaultValue`
yaooqinn commented on a change in pull request #1126:
URL: https://github.com/apache/incubator-kyuubi/pull/1126#discussion_r711580769
##########
File path: dev/kyuubi-extension-spark-3-1/src/main/scala/org/apache/kyuubi/sql/zorder/ZorderBytesUtils.scala
##########
@@ -171,30 +171,33 @@ object ZorderBytesUtils {
result
}
- def defaultValue(dataType: DataType): Any = dataType match {
- case BooleanType =>
- false
- case ByteType =>
- Byte.MaxValue
- case ShortType =>
- Short.MaxValue
- case IntegerType =>
- Int.MaxValue
- case LongType =>
- Long.MaxValue
- case FloatType =>
- Float.MaxValue
- case DoubleType =>
- Double.MaxValue
- case StringType =>
- UTF8String.fromBytes(new Array[Byte](0))
- case TimestampType =>
- Long.MaxValue
- case DateType =>
- Int.MaxValue
- case _: DecimalType =>
- Long.MaxValue
- case other: Any =>
- throw new KyuubiSQLExtensionException(s"Unsupported z-order type: ${other.catalogString}")
+ def defaultValue(dataType: DataType): Array[Byte] = {
+ val v = dataType match {
+ case BooleanType =>
+ false
+ case ByteType =>
+ Byte.MaxValue
+ case ShortType =>
+ Short.MaxValue
+ case IntegerType =>
+ Int.MaxValue
+ case LongType =>
+ Long.MaxValue
+ case FloatType =>
+ Float.MaxValue
+ case DoubleType =>
+ Double.MaxValue
+ case StringType =>
+ UTF8String.fromBytes(new Array[Byte](0))
+ case TimestampType =>
Review comment:
to L184
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org