Hi,
    建表语句为:
    CREATE TABLE x.log.yanfa_log (
    dt TIMESTAMP(3),
    conn_id STRING,
    sequence STRING,
    trace_id STRING,
    span_info STRING,
    service_id STRING,
    msg_id STRING,
    servicename STRING,
    ret_code STRING,
    duration STRING,
    req_body MAP<String,String>,
    res_body MAP<STRING,STRING>,
    extra_info MAP<STRING,STRING>,
    proctime AS PROCTIME(),
    WATERMARK FOR dt AS dt - INTERVAL '60' SECOND
) WITH (
    'connector.type' = 'kafka',
    'connector.version' = '0.11',
    'connector.topic' = 'x-log-yanfa_log',
    'connector.properties.bootstrap.servers' = '*****:9092',
    'connector.properties.zookeeper.connect' = '*****:2181',
    'connector.startup-mode' = 'latest-offset',
    'update-mode' = 'append',
    'format.type' = 'json',
    'format.fail-on-missing-field' = 'true'
);

join sql 可以查看历史记录里面有。

Best,
Junbao Zhang
________________________________
发件人: Leonard Xu <xbjt...@gmail.com>
发送时间: 2020年5月20日 10:50
收件人: user-zh <user-zh@flink.apache.org>
主题: Re: flink sql使用维表关联时报Temporal table join currently only supports 'FOR 
SYSTEM_TIME AS OF' left table's proctime field, doesn't support 'PROCTIME()'

Hi,

1.10(1.10.1)版本都是支持建表时用计算列声明proctime列的,temporal table也是支持join 和 left 
join的,我这边之前1.10 release时验证过[1],可以参考
方便把你们完整的sql 贴出来吗?


Best,
Leonard Xu
[1]
https://github.com/leonardBang/flink-sql-etl/blob/master/etl-job/src/main/resources/job-sql-1.10/kafka2hbase/KafkaJoinHbaseJoinMysql2Hbase.sql
 
<https://github.com/leonardBang/flink-sql-etl/blob/master/etl-job/src/main/resources/job-sql-1.10/kafka2hbase/KafkaJoinHbaseJoinMysql2Hbase.sql>


> 在 2020年5月19日,09:23,wind.fly....@outlook.com 写道:
>
> 我就是按照这里面的语法去做的,试验没有成功,能把你试验的create table和query sql语句贴出来吗?谢谢。
> ________________________________
> 发件人: 祝尚 <17626017...@163.com>
> 发送时间: 2020年5月19日 0:02
> 收件人: user-zh@flink.apache.org <user-zh@flink.apache.org>
> 主题: Re: flink sql使用维表关联时报Temporal table join currently only supports 'FOR 
> SYSTEM_TIME AS OF' left table's proctime field, doesn't support 'PROCTIME()'
>
> 可以的吧,jark大佬的例子http://wuchong.me/blog/2020/02/25/demo-building-real-time-application-with-flink-sql/
>  
> <http://wuchong.me/blog/2020/02/25/demo-building-real-time-application-with-flink-sql/>
> 也是这么用的,我也试过sql client和table api里面都没问题
>
>> 2020年5月18日 下午4:43,wind.fly....@outlook.com 写道:
>>
>> Hi,
>>  经过尝试,select时候调用PROCTIME()函数生成proctime字段是可行的,谢谢。
>> ________________________________
>> 发件人: 111 <xingh...@163.com>
>> 发送时间: 2020年5月18日 16:07
>> 收件人: user-zh@flink.apache.org <user-zh@flink.apache.org>
>> 主题: 回复: flink sql使用维表关联时报Temporal table join currently only supports 'FOR 
>> SYSTEM_TIME AS OF' left table's proctime field, doesn't support 'PROCTIME()'
>>
>> Hi,
>>
>>
>> 试验了下,proctime不能在建表时创建。需要在select的时候基于PROCTIME()函数生成。
>>
>>
>> 比如:
>> Select …., PROCTIME() AS proctime from xxx;
>> Select * from xxx t1 left join yyy for system_time as of t1.proctime as t2 
>> on t1.id = t2.id;
>> 这样才行。
>>
>>
>> Best,
>> Xinghalo
>

回复