File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
sql/src/main/scala/app/softnetwork/elastic/sql/query Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -54,13 +54,19 @@ case class SQLSearchRequest(
5454
5555 def update (): SQLSearchRequest = {
5656 (for {
57- from <- Option (this .copy(from = from.update(this )))
58- select <- Option (from.copy(select = select.update(from)))
57+ from <- Option (this .copy(from = from.update(this )))
58+ select <- Option (
59+ from.copy(
60+ select = select.update(from),
61+ groupBy = groupBy.map(_.update(from)),
62+ having = having.map(_.update(from))
63+ )
64+ )
5965 where <- Option (select.copy(where = where.map(_.update(select))))
60- groupBy <- Option (where.copy(groupBy = groupBy .map(_.update(where))))
61- having <- Option (groupBy.copy(having = having.map(_.update(groupBy))))
62- updated <- Option (having.copy(orderBy = orderBy.map(_. update(having))) )
63- } yield updated).get
66+ updated <- Option (where.copy(orderBy = orderBy .map(_.update(where))))
67+ } yield updated).getOrElse(
68+ throw new IllegalStateException ( " Failed to update SQLSearchRequest " )
69+ )
6470 }
6571
6672 lazy val scriptFields : Seq [Field ] = select.fields.filter(_.isScriptField)
You can’t perform that action at this time.
0 commit comments