[
https://issues.apache.org/jira/browse/CALCITE-5548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17698078#comment-17698078
]
Julian Hyde commented on CALCITE-5548:
--------------------------------------
[~askarbozcan], I saw your PR, and it looks basically good. A few comments:
* You had a good specification in the PR. Can you copy it here? (The PR gets
forgotten after the commit is merged to main, and people will find the
specification useful in future.)
* How about renaming SqlConvertMssqlFunction to SqlCastConvertFunction? It
will remind people that it's about data a type conversion, and will allow us to
support MySQL's CONVERT in future
* I'd rather avoid LOOKAHEAD 4 in the parser if we can. Can you try combining
the parsing of this function with the existing CONVERT? Make a decision based
on whether the first argument is a type or an expression, or possibly whether
you see the USING keyword.
* I agree with your rationale for ignoring the 'style' argument, and treatment
of NULL style.
* Add one test to SqlParserTest and one test to SqlOperatorTest (unit tests
will make future maintenance easier).
> Add support for MSSQL CONVERT function
> --------------------------------------
>
> Key: CALCITE-5548
> URL: https://issues.apache.org/jira/browse/CALCITE-5548
> Project: Calcite
> Issue Type: Improvement
> Reporter: Askar Bozcan
> Assignee: Askar Bozcan
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Add support for MSSQL CONVERT function (which is the same as CAST, with
> optional formatting)
> More info:
> [https://learn.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?view=sql-server-ver16]
> Example usage:
> {{SELECT CONVERT(DATETIME, '2017-08-25', 101)}}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)