用CAST(input as type) 试试? https://doris.apache.org/master/zh-CN/sql-reference/sql-functions/cast.html#description
在 2022/1/11 上午10:14,“胡晨光”<13866174...@126.com> 写入: 各位专家好, 感谢专家前期的技术支持。现在我遇到两个问题,请专家不吝赐教。 1、第一问题: 每条数据内有一个message_time是timestamp,是毫秒为单位的。 希望建立基于message_time的按照月或者天分区的一个表。 我的部分建表语句如下: PARTITION BY RANGE(message_time/1000) PARTITION p202201 VALUES LESS THAN (unix_timestamp('2022-02-01 00:00:00')) PARTITION p202202 VALUES LESS THAN (unix_timestamp('2022-03-01 00:00:00')), 两个报错:message_time/100和unix_timestamp。 我看了doris文档,例子中是采用单纯的date或者datetime类型去分区的,中间没有用函数。是不是我用法错误还是doris不支持 2、第二问题: 上述message_time是mysql的外表一个字段,我想直接采用insert into select from写入doris,如何在sql语句中直接转换成doris表的 datetime类型? -- Best Wishes Chenguang Hu tel: 0551-65391037 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@doris.apache.org For additional commands, e-mail: dev-h...@doris.apache.org