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

luoyuxia updated FLINK-27015:
-----------------------------
    Description: 
In hive, it's support to cast timestamp to decimal implictly with following sql:
{code:java}
create table t1 (c1 DECIMAL(38,6));
create table t2 (c2 TIMESTAMP);
insert into t1 select * from t2;
-- or
select cast(cast('2012-12-19 11:12:19.1234567' as timestamp) as 
decimal(30,8)){code}
But it'll throw exception "The cast conversion from TIMESTAMP type to NUMERIC 
type is not allowed" with Hive dialect in Flink. 

  was:
In hive, it's support to cast timestamp to decimal implictly with following sql:
{code:java}
create table t1 (c1 DECIMAL(38,6));
create table t2 (c2 TIMESTAMP);
insert into t1 select * from t2;{code}
But it'll throw exception "The cast conversion from TIMESTAMP type to NUMERIC 
type is not allowed" with Hive dialect in Flink. 


> Hive dialect supports cast timestamp to decimal
> -----------------------------------------------
>
>                 Key: FLINK-27015
>                 URL: https://issues.apache.org/jira/browse/FLINK-27015
>             Project: Flink
>          Issue Type: Sub-task
>            Reporter: luoyuxia
>            Priority: Major
>
> In hive, it's support to cast timestamp to decimal implictly with following 
> sql:
> {code:java}
> create table t1 (c1 DECIMAL(38,6));
> create table t2 (c2 TIMESTAMP);
> insert into t1 select * from t2;
> -- or
> select cast(cast('2012-12-19 11:12:19.1234567' as timestamp) as 
> decimal(30,8)){code}
> But it'll throw exception "The cast conversion from TIMESTAMP type to NUMERIC 
> type is not allowed" with Hive dialect in Flink. 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to