[
https://issues.apache.org/jira/browse/CALCITE-7456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
terran2010 updated CALCITE-7456:
--------------------------------
Description:
When we execute the following SQL with :
{code:java}
select TRY_CAST(gross_weight as bigint) as gross_weight_value from product
{code}
Cacltie will output:
{code:java}
SELECT SAFE_CAST([gross_weight] AS BIGINT) AS [GROSS_WEIGHT_VALUE] FROM
[foodmart].[product] {code}
We can find the following document, msSQL does not have the SAFE-CAST function,
we can consider optimizing it
[https://learn.microsoft.com/en-us/sql/t-sql/functions/try-cast-transact-sql?view=sql-server-ver17]
was:
When we execute the following SQL:
{code:java}
select TRY_CAST(gross_weight as bigint) as gross_weight_value from product
{code}
Cacltie will output:
{code:java}
SELECT SAFE_CAST([gross_weight] AS BIGINT) AS [GROSS_WEIGHT_VALUE] FROM
[foodmart].[product] {code}
We can find the following document, msSQL does not have the SAFE-CAST function,
we can consider optimizing it
https://learn.microsoft.com/en-us/sql/t-sql/functions/try-cast-transact-sql?view=sql-server-ver17
> Enable the TRY_CAST function to support the MSSQL dialect
> ---------------------------------------------------------
>
> Key: CALCITE-7456
> URL: https://issues.apache.org/jira/browse/CALCITE-7456
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.41.0
> Reporter: terran2010
> Priority: Major
> Labels: pull-request-available
>
> When we execute the following SQL with :
> {code:java}
> select TRY_CAST(gross_weight as bigint) as gross_weight_value from product
> {code}
> Cacltie will output:
> {code:java}
> SELECT SAFE_CAST([gross_weight] AS BIGINT) AS [GROSS_WEIGHT_VALUE] FROM
> [foodmart].[product] {code}
> We can find the following document, msSQL does not have the SAFE-CAST
> function, we can consider optimizing it
> [https://learn.microsoft.com/en-us/sql/t-sql/functions/try-cast-transact-sql?view=sql-server-ver17]
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)