Skip to content

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