Skip to content

Commit 6728a4d

Browse files
committed
compile
1 parent c13975f commit 6728a4d

File tree

11 files changed

+451
-430
lines changed

11 files changed

+451
-430
lines changed

linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/conf/DWCArgumentsParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package org.apache.linkis.common.conf
1919

20-
import org.apache.linkis.common.utils.{ParameterUtils, Logging}
20+
import org.apache.linkis.common.utils.{Logging, ParameterUtils}
2121

2222
import org.apache.commons.lang3.StringUtils
2323

linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/utils/VariableUtils.scala

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,18 @@ import org.apache.linkis.common.conf.Configuration
2121
import org.apache.linkis.common.exception.LinkisCommonErrorException
2222
import org.apache.linkis.common.variable
2323
import org.apache.linkis.common.variable._
24-
import org.apache.linkis.common.variable.DateTypeUtils.{getCurHour, getMonthDay, getToday, getYesterday}
25-
import org.apache.commons.lang3.{StringUtils, Strings}
24+
import org.apache.linkis.common.variable.DateTypeUtils.{
25+
getCurHour,
26+
getMonthDay,
27+
getToday,
28+
getYesterday
29+
}
30+
31+
import org.apache.commons.lang3.{Strings, StringUtils}
2632

2733
import java.time.ZonedDateTime
2834
import java.util
35+
2936
import scala.collection.JavaConverters._
3037
import scala.collection.mutable
3138
import scala.util.control.Exception.allCatch
@@ -115,7 +122,9 @@ object VariableUtils extends Logging {
115122
case _ =>
116123
if (!nameAndType.contains(key) && StringUtils.isNotEmpty(value)) {
117124
// if ((allCatch opt value.toDouble).isDefined) {
118-
if ((allCatch opt BigDecimal(value)).isDefined && !Strings.CS.startsWith(value, "0")) {
125+
if (
126+
(allCatch opt BigDecimal(value)).isDefined && !Strings.CS.startsWith(value, "0")
127+
) {
119128
nameAndType(key) = variable.BigDecimalValue(BigDecimal(value))
120129
} else {
121130
nameAndType(key) = variable.StringType(value)

linkis-commons/linkis-common/src/main/scala/org/apache/linkis/common/variable/VariableType.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ case class YearType(value: CustomYearType) extends VariableType {
111111
}
112112

113113
case class BigDecimalValue(value: BigDecimal) extends VariableType {
114+
114115
override def getValue: String = {
115116
val result = bigDecimalOrLong(value)
116117
result match {
@@ -126,7 +127,10 @@ case class BigDecimalValue(value: BigDecimal) extends VariableType {
126127
case "*" => val res = value * BigDecimal(bValue); formatResult(res)
127128
case "/" => val res = value / BigDecimal(bValue); formatResult(res)
128129
case _ =>
129-
throw new LinkisCommonErrorException(20050, s"BigDecimal class is not supported to use:$signal")
130+
throw new LinkisCommonErrorException(
131+
20050,
132+
s"BigDecimal class is not supported to use:$signal"
133+
)
130134
}
131135
}
132136

@@ -146,6 +150,7 @@ case class BigDecimalValue(value: BigDecimal) extends VariableType {
146150
bd
147151
}
148152
}
153+
149154
}
150155

151156
case class LongType(value: Long) extends VariableType {

0 commit comments

Comments
 (0)