回复: flink1.11 流式读取hive怎么设置 process_time 和event_time?

2020-08-30 文章 sllence
Hi Zou Dan:

可以尝试下立刻语句是否可行
https://ci.apache.org/projects/flink/flink-docs-master/dev/table/sql/create.html#create-table

CREATE TABLE Orders (
user BIGINT,
product STRING,
order_time TIMESTAMP(3)
) WITH ( 
'connector' = 'kafka',
'scan.startup.mode' = 'earliest-offset'
);

CREATE TABLE Orders_with_watermark (
-- Add watermark definition
WATERMARK FOR order_time AS order_time - INTERVAL '5' SECOND 
) WITH (
-- Overwrite the startup-mode
'scan.startup.mode' = 'latest-offset'
)
LIKE Orders;

-邮件原件-
发件人: me  
发送时间: 2020年8月30日 22:16
收件人: user-zh 
抄送: zoudanx 
主题: Re: flink1.11 流式读取hive怎么设置 process_time 和event_time? 

如果是直接连接的hive catalog呢,是hive中已存在的表,直接去流式的连接读取?
您那有什么可解决的想法吗?


 原始邮件 
发件人: Zou Dan
收件人: user-zh
发送时间: 2020年8月30日(周日) 21:55
主题: Re: flink1.11 流式读取hive怎么设置 process_time 和event_time?


Event time 是通过 DDL 中 watermark 语句设置的,具体可以参考文档 [1] [1] 
https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/sql/create.html#create-table
 
<">https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/sql/create.html#create-table>
 Best, Dan Zou > 2020年8月30日 下午9:42,me  写道: > > flink1.11 
可以使用在使用select语句时,显式的指定是流式读取,流式的读出出来之后如果想使用实时计算中的特性窗口函数然后指定时间语义 
事件时间和处理时间,但是flink sql需要显示的定义数据中的时间字段才能识别为 event_time,求问这个怎么去设置。


Re: flink1.11 流式读取hive怎么设置 process_time 和event_time?

2020-08-30 文章 Rui Li
Hi,

这个场景目前还是不支持的。定义watermark需要在DDL里做,hive表本身没有这个概念,所以DDL里定义不了。以后也许可以通过额外的参数来指定watermark。

On Sun, Aug 30, 2020 at 10:16 PM me  wrote:

> 如果是直接连接的hive catalog呢,是hive中已存在的表,直接去流式的连接读取?
> 您那有什么可解决的想法吗?
>
>
>  原始邮件
> 发件人: Zou Dan
> 收件人: user-zh
> 发送时间: 2020年8月30日(周日) 21:55
> 主题: Re: flink1.11 流式读取hive怎么设置 process_time 和event_time?
>
>
> Event time 是通过 DDL 中 watermark 语句设置的,具体可以参考文档 [1] [1]
> https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/sql/create.html#create-table
> <">
> https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/sql/create.html#create-table>
> Best, Dan Zou > 2020年8月30日 下午9:42,me  写道: > > flink1.11
> 可以使用在使用select语句时,显式的指定是流式读取,流式的读出出来之后如果想使用实时计算中的特性窗口函数然后指定时间语义
> 事件时间和处理时间,但是flink sql需要显示的定义数据中的时间字段才能识别为 event_time,求问这个怎么去设置。



-- 
Best regards!
Rui Li


Re: flink1.11 流式读取hive怎么设置 process_time 和event_time?

2020-08-30 文章 me
如果是直接连接的hive catalog呢,是hive中已存在的表,直接去流式的连接读取?
您那有什么可解决的想法吗?


 原始邮件 
发件人: Zou Dan
收件人: user-zh
发送时间: 2020年8月30日(周日) 21:55
主题: Re: flink1.11 流式读取hive怎么设置 process_time 和event_time?


Event time 是通过 DDL 中 watermark 语句设置的,具体可以参考文档 [1] [1] 
https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/sql/create.html#create-table
 
<">https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/sql/create.html#create-table>
 Best, Dan Zou > 2020年8月30日 下午9:42,me  写道: > > flink1.11 
可以使用在使用select语句时,显式的指定是流式读取,流式的读出出来之后如果想使用实时计算中的特性窗口函数然后指定时间语义 
事件时间和处理时间,但是flink sql需要显示的定义数据中的时间字段才能识别为 event_time,求问这个怎么去设置。

Re: flink1.11 流式读取hive怎么设置 process_time 和event_time?

2020-08-30 文章 Zou Dan
Event time 是通过 DDL 中 watermark 语句设置的,具体可以参考文档 [1]

[1] 
https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/sql/create.html#create-table
 


Best,
Dan Zou

> 2020年8月30日 下午9:42,me  写道:
> 
> flink1.11 可以使用在使用select语句时,显式的指定是流式读取,流式的读出出来之后如果想使用实时计算中的特性窗口函数然后指定时间语义  
> 事件时间和处理时间,但是flink sql需要显示的定义数据中的时间字段才能识别为 event_time,求问这个怎么去设置。



flink1.11 流式读取hive怎么设置 process_time 和event_time?

2020-08-30 文章 me
flink1.11 可以使用在使用select语句时,显式的指定是流式读取,流式的读出出来之后如果想使用实时计算中的特性窗口函数然后指定时间语义  
事件时间和处理时间,但是flink sql需要显示的定义数据中的时间字段才能识别为 event_time,求问这个怎么去设置。