Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDBC Native fails on variable not found when @infoDate is used as part of a function #489

Closed
yruslan opened this issue Sep 25, 2024 · 0 comments · Fixed by #490
Closed
Labels
bug Something isn't working

Comments

@yruslan
Copy link
Collaborator

yruslan commented Sep 25, 2024

Describe the bug

JDBC Native SQL queries allow specifying arbitrary expressions, like an example below. But an error occurs when used this way:

za.co.absa.pramen.core.expr.exceptions.SyntaxErrorException: Unset variable 'infoDate' used.
  at za.co.absa.pramen.core.expr.parser.DateExpressionEvaluator.addVariable(DateExpressionEvaluator.scala:48)
  at za.co.absa.pramen.core.expr.parser.Parser.$anonfun$parse$1(Parser.scala:105)

Code and/or configuration snippet that caused the issue

input.sql =

SELECT * FROM my_table WHERE date_col='@{yearMonthOf(plusMonths(@infoDate, 1))}-16'

Expected behavior

Pramen should return a valid date and not throw an exception in this situation.

Context

  • Pramen/pramen-py version: 1.8.9
  • Spark version:
  • Scala/Python version:
  • Operating system:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant