Skip to content

Commit

Permalink
Fix SQL generation
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichard committed Apr 4, 2023
1 parent 8a6a4f9 commit 9bdcd87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,7 @@ object Expression {

case class Extract(interval: IntervalField, expr: Expression, nodeLocation: Option[NodeLocation]) extends Expression {
override def children: Seq[Expression] = Seq(expr)
override def sqlExpr: String = s"EXTRACT(${interval.sqlExpr} FROM ${expr.sqlExpr})"
override def toString = s"Extract(interval:${interval}, ${expr})"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ object SQLGenerator extends LogSupport {
case l: Literal =>
l.sqlExpr
case g: GroupingKey =>
g.index.getOrElse(printExpression(g.child)).toString
g.sqlExpr
case ParenthesizedExpression(expr, _) =>
s"(${printExpression(expr)})"
case a: Alias =>
Expand Down

0 comments on commit 9bdcd87

Please sign in to comment.