nielspardon opened a new pull request, #3972:
URL: https://github.com/apache/calcite/pull/3972

   This PR adds validation of prefixed column identifiers in SET clause of 
UPDATE statement (and in the UPDATE statement within a MERGE statement)
   
   - I first had to change `SqlValidatorUtil.addFields()` to use the `alias_()` 
method for getting the last element of a compound identifier instead of relying 
on simple identifiers
   - I then implemented a validation logic in 
`SqlValidatorImpl.createTargetRowType()` which is being used for validating 
INSERT, UPDATE and MERGE
   - in presence of the new `targetTableAlias` parameter the validation logic 
checks the prefix of any non-simple identifiers or in other words it checks 
that any prefixed column identifiers are prefixed with the target table alias
   - I tried to check for any existing validation logic that I could reuse and 
it's possible I might have missed a utility method that I could have used.
   - The validation logic supports a mix of prefixed and unprefixed columns in 
the SET clause. Not sure if I should only allow prefixed columns here.
   
   Let me know your thoughts.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to