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

   ## Jira Link
   
   [CALCITE-7756](https://issues.apache.org/jira/browse/CALCITE-7756)
   
   ## Changes Proposed
   
   This PR fixes `MSSQL` unparse for `CAST(... AS VARCHAR)` when no precision 
is specified. `SQL Server` does not treat a bare `VARCHAR` as unbounded; it 
uses an implicit default length, which can truncate values or trigger 
conversion errors. The dialect now emits `VARCHAR(MAX)` for unspecified 
`VARCHAR` precision, while preserving explicit lengths such as `VARCHAR(100)`. 
This matches `SQL Server` behavior and prevents data loss during `CAST` 
generation.


-- 
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