Skip to content

Commit

Permalink
fixbug:
Browse files Browse the repository at this point in the history
	修复 “系统默认的变量”会覆盖掉“custom设置的变量”的bug
  • Loading branch information
周岑 committed Aug 3, 2018
1 parent fdc57fc commit d6b3803
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object TemplateMerge {
"tomorrow" -> DateTime.now().plusDays(1).toString(dformat),
"theDayBeforeYesterday" -> DateTime.now().minusDays(2).toString(dformat)
)
val newRoot = root ++ predified_variables
val newRoot = predified_variables ++ root

RenderEngine.render(sql, newRoot)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package streaming.dsl.template

import org.scalatest.{FlatSpec, Matchers}
import streaming.core.NotToRunTag

class TemplateMergeSpec extends FlatSpec with Matchers {


"template merge" should "work" taggedAs (NotToRunTag) in {
val sql = TemplateMerge.merge("${yesterday}",Map[String,String]("yesterday"->"2017-03-01"))
assume(sql == "2017-03-01")
}

}

0 comments on commit d6b3803

Please sign in to comment.