Skip to content

Commit d3c49d6

Browse files
committed
fix scala2.12 compilation bug
1 parent 2eeaf08 commit d3c49d6

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

sql/src/main/scala/app/softnetwork/elastic/sql/function/time/package.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ package object time {
447447

448448
def includeTimeZone: Boolean = false
449449

450-
protected def param: String = s"DateTimeFormatter.ofPattern(\"${convert()}\")"
450+
protected def param: String = "DateTimeFormatter.ofPattern(\"" + convert() + "\")"
451451

452452
val sqlToJava: Map[String, String] = Map(
453453
"%Y" -> "yyyy",

sql/src/main/scala/app/softnetwork/elastic/sql/type/SQLTypeUtils.scala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,26 +193,30 @@ object SQLTypeUtils {
193193
context match {
194194
case Some(ctx) =>
195195
ctx.addParam(
196-
LiteralParam(s"LocalDate.parse($expr, DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"))")
196+
LiteralParam(
197+
"LocalDate.parse(" + expr + ", DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"))"
198+
)
197199
) match {
198200
case Some(p) => return p
199201
case None => // continue
200202
}
201203
case None => // continue
202204
}
203-
s"LocalDate.parse($expr, DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"))"
205+
"LocalDate.parse(" + expr + ", DateTimeFormatter.ofPattern(\"yyyy-MM-dd\"))"
204206
case (SQLTypes.Varchar, SQLTypes.Time) =>
205207
context match {
206208
case Some(ctx) =>
207209
ctx.addParam(
208-
LiteralParam(s"LocalTime.parse($expr, DateTimeFormatter.ofPattern(\"HH:mm:ss\"))")
210+
LiteralParam(
211+
"LocalTime.parse(" + expr + ", DateTimeFormatter.ofPattern(\"HH:mm:ss\"))"
212+
)
209213
) match {
210214
case Some(p) => return p
211215
case None => // continue
212216
}
213217
case None => // continue
214218
}
215-
s"LocalTime.parse($expr, DateTimeFormatter.ofPattern(\"HH:mm:ss\"))"
219+
"LocalTime.parse(" + expr + ", DateTimeFormatter.ofPattern(\"HH:mm:ss\"))"
216220
case (SQLTypes.Varchar, SQLTypes.DateTime) =>
217221
context match {
218222
case Some(ctx) =>

0 commit comments

Comments
 (0)