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

Bugfix- isNonNegative and isPositive checks #573

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SagarMoghe
Copy link

Issue #, if available:

Description of changes:
existing isNonNegative and isPositive function does not work well with columns that have white space in between, and results in breaking of other constraints as well. I added extra quotes around the column name so columns with white space in the name does not break the final generated query.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

existing isNonNegative and isPositive function does not work well with columns that have white space in between, and results in breaking of other constraints as well. I added extra quotes around the column name so columns with white space in the name does not break the final generated query.
Update Check.scala
existing isNonNegative and isPositive function does not work well with columns that have white space in between, and results in breaking of other constraints as well. I added extra quotes around the column name so columns with white space in the name does not break the final generated query.
@SagarMoghe
Copy link
Author

SagarMoghe commented Aug 21, 2024

column name: Customer ID
constraint:
ComplianceConstraint(Compliance(Customer ID is non-negative,COALESCE(CAST(Customer ID AS DECIMAL(20,10)), 0.0) >= 0,None,List(Customer ID),None))

constraint_message:
org.apache.spark.sql.catalyst.parser.ParseException: \n[PARSE_SYNTAX_ERROR] Syntax error at or near '('.(line 1, pos 13)\n\n== SQL ==\nCOALESCE(CAST(Customer ID AS DECIMAL(20,10)), 0.0) >= 0\n-------------^^^\n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant