[ 
https://issues.apache.org/jira/browse/CALCITE-6796?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

xiaochen.zhou updated CALCITE-6796:
-----------------------------------
    Description: 
Since BINARY  type is not supported in Presto

According to the documentation:

[https://prestodb.io/docs/current/language/types.html#varbinary]

```

Using {{CAST(xxxx AS BINARY)}} will result in an error:

```
SELECT cast(task_id as binary)
from applydata_bigdata.xflink_task_info
where reader_info like '%mongodbreader%' or writer_info like '%mongodbwriter%';
{{```}}

 

It should be converted to the VARBINARY type instead.

  was:
Since BINARY  type is not supported in Presto

According to the documentation:

https://prestodb.io/docs/current/language/types.html#varbinary

```

Using {{CAST(xxxx AS 
[FLOAT|https://prestodb.io/docs/current/language/types.html#varbinary])}} will 
result in an error:

```

SELECT CAST(message_count AS FLOAT)

FROM applydata_bigdata.kafka_topic_cluster_user_dept_month_one_day_msg_info

{{WHERE ymd = 20250105}}

{{```}}

!https://note3.oss-cn-hangzhou.aliyuncs.com/source/image-20250109061448068.png!

It should be converted to the DOUBLE type instead.


> Convert Type from BINARY to VARBINARY in PrestoDialect 
> -------------------------------------------------------
>
>                 Key: CALCITE-6796
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6796
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: xiaochen.zhou
>            Priority: Minor
>              Labels: pull-request-available
>
> Since BINARY  type is not supported in Presto
> According to the documentation:
> [https://prestodb.io/docs/current/language/types.html#varbinary]
> ```
> Using {{CAST(xxxx AS BINARY)}} will result in an error:
> ```
> SELECT cast(task_id as binary)
> from applydata_bigdata.xflink_task_info
> where reader_info like '%mongodbreader%' or writer_info like 
> '%mongodbwriter%';
> {{```}}
>  
> It should be converted to the VARBINARY type instead.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to