Re: 退订

2021-08-11 Thread Leonard Xu
如果需要取消订阅 user-zh@flink.apache.org 邮件组,请发送任意内容的邮件到 user-zh-unsubscr...@flink.apache.org Best, Leonard > 在 2021年8月6日,10:49,汪嘉富 写道: > > 退订 >

Re: 退订

2021-08-11 Thread Leonard Xu
如果需要取消订阅 user-zh@flink.apache.org 邮件组,请发送任意内容的邮件到 user-zh-unsubscr...@flink.apache.org Best, Leonard > 在 2021年8月11日,08:16,Lee2097 写道: > > 退订

Re: Flink CDC job getting failed due to G1 old gc

2021-08-02 Thread Leonard Xu
t; > .tableSchema(FlinkSchemaUtil.toSchema(FlinkSchemaUtil.convert(icebergTable.schema( > .tableLoader(tableLoader) > .equalityFieldColumns(tableConfig.getEqualityColumns()) > .build(); > > Please let me know if you need some other information too > > > On Mon,

Re: Flink CDC job getting failed due to G1 old gc

2021-08-01 Thread Leonard Xu
Hi, Ayush Thanks for the detailed description. Before analyze the issue, I have two questions that which Flink and Flink CDC version are you using? Is Flink CDC used in SQL or DataStream ? That’s helpful if you can post you Flink CDC connector parameters. Best, Leonard > 在

Re: flink 1.13.1 使用hive方言,执行hive sql解析报错

2021-07-29 Thread Leonard Xu
看起来是sql语法报错,这里面的ELSE呢? 祝好, Leonard > 在 2021年7月27日,20:04,Asahi Lee <978466...@qq.com.INVALID> 写道: > > CASE > WHEN mipd.`param_cn` = '月池尺寸' THEN > mipv.`param_value` > END AS `Moonpool`

Re: 退订

2021-07-28 Thread Leonard Xu
如果需要取消订阅 user-zh@flink.apache.org 邮件组,是发送任意内容的邮件到 user-zh-unsubscr...@flink.apache.org > 在 2021年7月28日,10:52,赵珠峰 写道: > > 退订 > > > > 本邮件载有秘密信息,请您恪守保密义务。未经许可不得披露、使用或允许他人使用。谢谢合作。 > This email contains confidential information. Recipient is obliged to keep > the information confidential.

Re: 退订

2021-06-28 Thread Leonard Xu
如果需要取消订阅 u...@flink.apache.org 邮件组,请发送任意内容的邮件到 user-zh-unsubscr...@flink.apache.org 。 > 在 2021年6月29日,11:01,大雨 <95133...@qq.com.INVALID> 写道: > > 退订

Re: How to convert local to iso 8601 time in flink sql?

2021-06-28 Thread Leonard Xu
Hi, Unfortunately Flink SQL doesn’t support TIMESTAMP WITH TIME ZONE type yet[1], maybe the you can try write an UDF to convert the timestamp '2021-06-29 09:00:00’ field to String(the string representation like '2021-06-29T09:00:00+08:00’). And could you share your scenario about using

Re: Processing-time temporal join is not supported yet

2021-06-23 Thread Leonard Xu
会保留维表状态的,靠watermark清理过期数据。 祝好 Leonard > 在 2021年6月23日,19:20,op <520075...@qq.com.INVALID> 写道: > > 谢谢,Event time temporal join > 会保存temporal每个的key的最新状态吗,官网文档说跟两边watermark有关,每太看明白。。。 > > > > > --原始邮件-- > 发件人:

Re: Processing-time temporal join is not supported yet

2021-06-23 Thread Leonard Xu
Hi, Flink SQL 目前支持 Event time temporal join 任意表/视图,还不支持 Processing-time temporal join 任意表/视图(支持Processing-time join 实现了LookupTableSource的表)。 Processing-time temporal join 任意表目前不支持的原因主要是语义问题,具体来说: 在Processing time关联时,Flink SQL 层面还没比较好的机制保证维表加载完后再关联。比如如用来做维表流的kafka中有 1000万 条数据,但目前没有办法实现将这

Re: Flink TPC-DS 3TB BenchMark result is not good.

2021-06-22 Thread Leonard Xu
Hi, vtygoss Thanks for the detail report, a quick reply as I wrote the org.apache.flink.table.tpcds.TpcdsTestProgram in community, I guess you missed table statistics information. The table statistics information used in the TPC-DS e2e tests is constant for 1GB verification data set, I wrote

Re: flink sql cdc如何获取元数据

2021-06-22 Thread Leonard Xu
Hello, Flink sql cdc 还不支持获取元数据, 获取元数据的业务场景通常是怎么样的呢? 祝好, Leonard > 在 2021年6月23日,08:21,casel.chen 写道: > > flink sql cdc如何获取元数据?像数据库名,表名,操作类型,binlog产生时间等。 > > > create table xxx_tbl ( > k_op varchar, -- 操作类型 > k_database varchar, -- 数据库名 > k_table varchar, -- 表名 > k_ts. BIGINT, --

Re: 动态选择流

2021-06-22 Thread Leonard Xu
你的动态规则是怎么输入的? 流作业都是预先编译好作业拓扑,然后再调度运行,动态调整作业拓扑基本可不能。 祝好, Leonard > 在 2021年6月22日,20:10,梁鲁江 写道: > > 你好, > 麻烦问一下,有没有API或者实现方式来动态选择多个流。 > 例如我有A、B、C三条流,我的动态规则1要去joinA、B ,关联条件不定;动态规则2要去join B、C两条流 ……

Re: unsubscribe

2021-06-22 Thread Leonard Xu
You should send an email to user-unsubscr...@flink.apache.org if you want to unsubscribe the mails from user@flink.apache.org Best, Leonard > 在 2021年6月21日,15:33,steven chen 写道: > > unsubscribe > > >

Re: 场景实现咨询

2021-06-20 Thread Leonard Xu
Hi, 你可以试下 event time 的 temporal join, 把订单扩展信息表作为版本表。 Best, Leonard [1] https://ci.apache.org/projects/flink/flink-docs-master/zh/docs/dev/table/sql/queries/joins/#event-time-temporal-join > 在 2021年6月20日,11:33,chenchencc <1353637...@qq.com.INVALID> 写道: > > 大佬们好,我有个生产场景,不知道怎么用flink sql实现。想咨询下。

Re: Flink sql case when problem

2021-06-17 Thread Leonard Xu
Hi, houying It looks like a bug when code generate the operator code, which Flink version are you using? Could you help create an JIRA ticket? Best, Leonard > 在 2021年6月17日,19:48,纳兰清风 写道: > > Hello, > > When I am using case when statement in flink sql, I got an error as > follow: >

Re: flink sql cdc做计算后, elastic search connector 多并发sink 会有问题,偶现!数据量较大,目前还没较好复现。请问有人是否也遇到过类似的问题。

2021-06-16 Thread Leonard Xu
看起来和 Flink-CDC 关系不大,看异常栈是 ES 侧抛出的异常 version_conflict_engine_exception, 可以查下这个异常,看下是不是有写(其他作业/业务 也在写同步表)冲突。 祝好, Leonard > 在 2021年6月16日,17:05,mokaful <649713...@qq.com> 写道: > > 相同问题,请问有处理方式吗 > > > > -- > Sent from: http://apache-flink.147419.n8.nabble.com/

Re: confused about `TO_TIMESTAMP` document description

2021-06-10 Thread Leonard Xu
Hi,Tony > I found this code snippet [2] might be related to `TO_TIMESTAMP` udf, and > seems like it won't set use any timezone configuration, so maybe the document > might be wrong. Your analysis is right,the document is wrong, we should correct it. Would you like to create an jira ticket and

Re: flink sql cdc数据同步至mysql

2021-06-08 Thread Leonard Xu
试着回答下这两个问题。 > flink 1.12的jdbc connector不支持 sink.parallism 参数,是不是说只能和上游cdc > connector保持相同的并行度1?如果是的话,下游sink会有瓶颈,因为表中存有大量的历史数据,将存量数据同步到目标表需要花费不少时间,而新的业务数据也源源不断进来,导致追不上。这要如何解决? 是的,关键问题是cdc connector为了保证数据一致性只能单并发,所以作业也只能单并发。这个需要cdc connector支持多并发读取,下游sink自然就能解决。 > flink 1.13的jdbc connector新增

Re: How to unsubscribe?

2021-06-08 Thread Leonard Xu
Hi, Morgan Just send an email with any content to user-unsubscr...@flink.apache.org will unsubscribe the mail from Flink user mail list. And also send an email to with any content to dev-unsubscr...@flink.apache.org

Re: flink自定义connector相关报错

2021-06-02 Thread Leonard Xu
路径错了 > 在 2021年6月2日,17:02,MOBIN <18814118...@163.com> 写道: > > META-INF.services/org.apache.flink.table.factories.Factory => META-INF/services/org.apache.flink.table.factories.Factory 祝好 Leonard

Re: flink1.13 通过sql cli执行hdfs上面的SQL文件

2021-05-30 Thread Leonard Xu
> > 目前还不支持HDFS路径,只支持本地的文件,未来应该会支持. 是的, 目前还不支持,只支持本地文件,这个异常信息不是很明确 https://issues.apache.org/jira/browse/FLINK-22795 祝好, Leonard > > > > - > Best Wishes > JasonLee > -- > Sent from: http://apache-flink.147419.n8.nabble.com/

Re: flink 1.13.0 中cumulate window 使用

2021-05-27 Thread Leonard Xu
Hi, Cumulate window 是基于 window TVF 语法的,和之前的 groupWindowFunction 不一样, 你可以参考 [1] Window TVF 也支持了 tumble window, hop window, 并且性能更优,session window 预计会在1.14支持, session window 有需要可以使用老的语法。 Best, Leonard [1]

Re: flink 维表

2021-05-27 Thread Leonard Xu
Hi > 1, 这个时态表必须是changlog流吗, 就是debezium - kafka 这样, 用和主表的flink cdc不可以吗, > 我用flink cdc测试没成功,因为flink cdc的维表好像不能指定watermark? 我们常说的 lookup维表也是时态表的一种,lookup 正如这个单词字面意思一样,主流的每条数据到来时都按 lookup key 去外部DB中 查询 一条记录,这张维表自然就是最新的维表,这就是 proctime temporal join 的语义。 基于 Event-time temporal join,是按照 event-time

Re: [VOTE] Release 1.13.1, release candidate #1

2021-05-27 Thread Leonard Xu
+1 (non-binding) - verified signatures and hashes - built from source code with scala 2.11 succeeded - started a cluster, WebUI was accessible, ran a window word count job, no suspicious log output - ran some SQL jobs in SQL Client, the queries result is expected - the web PR looks good Best,

Re: flink 维表

2021-05-27 Thread Leonard Xu
HI, 可以修改的,修改后不需要重启作业。 修改后 flink 事实流 是能立即 查询到 最新的维表数据(前提是维表查询出来的数据没有开启cache)。 你可以理解下 lookup 维表的语法: A join B for system time as of A.proctime on A.id = B.id 就是 查询当前最新的维表(proctime代表了最新时间)并关联。 祝好, Leonard > 在 2021年5月27日,16:35,liujian <13597820...@qq.com> 写道: > >

Re: flink问题咨询

2021-05-17 Thread Leonard Xu
Hello 你可以把具体的问题描述清楚点,比如给出一些数据和sql,能够复现你遇到的问题,这样大家才能帮忙排查。 祝好, Leonard Xu > 在 2021年5月18日,09:49,清酌 写道: > > 您好! > 我在使用1.11版本flink sql cdc > 时候,用sql形式想对多表关联生成实时的宽表,发现经常出现宽表的数据不准。特别是源表在cdc变更时候。比如:宽表本应该10条数据变更,但是实际只变更了3条。 > 我想知道这个问题是基于我使用不当产生的还是1.11版本的问题,如果是版本的问题后续会修复吗?

Re: 维度表 处理时间

2021-05-17 Thread Leonard Xu
只需要最新的维表数据,可以用处理时间,这样是事实表每条都实时去查mysql最新维表数据; 如果业务可以接受近似最新的维表数据,也可以将查询的维表结果通过缓存优化,减少访问mysql io访问,这两个参数: lookup.cache.max-rows" lookup.cache.ttl 祝好, Leonard [1] https://ci.apache.org/projects/flink/flink-docs-master/zh/docs/connectors/table/jdbc/#%E8%BF%9E%E6%8E%A5%E5%99%A8%E5%8F%82%E6%95%B0 > 在

Re: UpsertStreamTableSink requires that Table has a full primary keys if it is updated.

2021-05-14 Thread Leonard Xu
这里说的 PK 是定义在你结果表 DDL 上的PK,最开始的报错信息应该是你结果表上没声明PK吧。 你自定义的 connector 支持 upsert 的话,参考下 HBaseUpsertTableSink 的实现,你的 sink 获取到 Factory Context 中schema 的 pk 后,需要按照 upsert 语义处理下。 祝好, Leonard > On May 14, 2021, at 15:39, automths wrote: > > Hi: > > 该问题有进一步的进展了。 > > > 我把cdc对应的表在创建表时设置了primary

Re: Table name for table created fromDataStream

2021-05-07 Thread Leonard Xu
> 在 2021年5月8日,08:00,tbud 写道: > > Hi Leonard, > Yes that would be one solution. But why is it necessary to create a > temporaryView from already created table ? The name “Table” is quite misleading here, the table API object Table actually represents a relational query (e.g. Table table =

Re: FlieSystem Connector's Success File Was Submitted Late

2021-05-07 Thread Leonard Xu
Hi, forideal I also encountered this problem and opened an issue[1], you can have a look. Best, Leonard [1] https://issues.apache.org/jira/browse/FLINK-22472 > 在 2021年5月7日,20:31,forideal 写道: > > I found the reason: > >Late data processing: The record will be written into its partition

Re: Watermark time zone issue

2021-05-07 Thread Leonard Xu
Hi, forideal It’s not because the time zone issue, the watermark value is timestamp in UTC mills, you should convert it to UTC timestamp and then compare with your data. Best, Leonard > 在 2021年5月7日,18:28,forideal 写道: > > Hi My friends: > My watermark added 8 more hours to the timestamp

Re: 扩展SqlServerDialect 运行在flink on k8s报错

2021-05-07 Thread Leonard Xu
Hi 看日志是加载不到对应的class文件,(1)可以对比下你jar包里的路径是不是不正确,(2) 检查下集群上是不是还有之前的jar包,没替换干净 祝好 Leonard > 在 2021年5月7日,13:58,18756225...@163.com 写道: > > 大家好,遇到一个问题: > 坏境:flink 版本1.12.1, k8s集群为session模式, 该集群之前可以将数据正常写入到mysql > 参考mysqlDialect 扩展了一个 >

Re: Table name for table created fromDataStream

2021-05-06 Thread Leonard Xu
Hi, tbud You can register the Table API object as a temporary view and then run query on it: tableEnv.createTemporaryView(“MyTable”, eventsTable); tableEnv.executeSql(“SELECT * FROM MyTable“).print(); Best, Leonard > 在 2021年5月7日,03:17,tbud 写道: > > Does anybody know how to set the name for

Re: [ANNOUNCE] Apache Flink 1.13.0 released

2021-05-05 Thread Leonard Xu
Thanks Dawid & Guowei for the great work, thanks everyone involved. Best, Leonard > 在 2021年5月5日,17:12,Theo Diefenthal 写道: > > Thanks for managing the release. +1. I like the focus on improving operations > with this version. > > Von: "Matthias Pohl" > An: "Etienne Chauchot" > CC: "dev" ,

Re: Watermarks in Event Time Temporal Join

2021-04-28 Thread Leonard Xu
Thanks for your example, Maciej I can explain more about the design. > Let's have events. > S1, id1, v1, 1 > S2, id1, v2, 1 > > Nothing is happening as none of the streams have reached the watermark. > Now let's add > S2, id2, v2, 101 > This should trigger join for id1 because we have all the

Re: Watermarks in Event Time Temporal Join

2021-04-27 Thread Leonard Xu
Hello, Maciej > I agree the watermark should pass on versioned table side, because > this is the only way to know which version of record should be used. > But if we mimics behaviour of interval join then main stream watermark > could be skipped. IIRC, rowtime interval join requires the watermark

Re: 設置look up table source

2021-04-21 Thread Leonard Xu
Hi, ChongAih 你可以参考 JdbcDynamicTableSource [1] 这个 table source 实现了 LookupTableSource 接口,你需要写一个类似 JdbcRowDataLookupFunction 即可 的函数即可。 祝好, Leonard [1]

Re: flink-sql-connector-elasticsearch6_2.11_1.10.0 与 flink-connector-elasticsearch6_2.11_1.10.0 并存问题

2021-04-20 Thread Leonard Xu
Hi 如果只是sql作业,使用flink-sql-connector-elasticsearch6_2.11_1.10.0 就可以了,如果纯datastream作业使用flink-connector-elasticsearch6_2.11_1.10.0 就可以了 如果两个包都要使用,有两个思路 1. 你自己自己打个包,把上面两个包的依赖放在一起。 2. 和1类似,shade掉flink-connector-elasticsearch6_2.11_1.10.0 我没实际打过,你可以动手试下。 祝好 > 在 2021年4月20日,14:13,william

Re: 退订

2021-04-12 Thread Leonard Xu
On Mon, Apr 12, 2021 at 3:06 PM yangxiaofei wrote: > 退订 > > Hi 是指取消订阅邮件吗?取消和订阅邮件组 不是直接发给邮件组, Apache的邮件组管理都类似。 请发送任意内容的邮件到 user-zh-unsubscr...@flink.apache.org 就可以取消订阅 user-zh@flink.apache.org 邮件列表 邮件列表的订阅管理,可以参考[1] 祝好, Leonard Xu [1] https://flink.apache.org/community

Re: BUG :DataStream 转 Table 后无法 触发窗口计算

2021-03-09 Thread Leonard Xu
你好, 你的flink版本是多少? 之前有个bug是Table转datastream 会丢rowtime问题,看起来是这个问题。 我在[1]里修复了,你可以升级对应的版本试下。 祝好, Leonard [1]https://issues.apache.org/jira/browse/FLINK-21013 > 在 2021年3月10日,14:34,HunterXHunter <1356469...@qq.com> 写道: > > 再试了一下: > 修改并行度也不行 >

Re: [ANNOUNCE] Apache Flink 1.12.2 released

2021-03-08 Thread Leonard Xu
Well done! Thanks to Roman and Yuan, and everyone who contributed to the release. Best, Leonard > 在 2021年3月9日,11:39,Zhu Zhu 写道: > > Thanks Roman and Yuan for being the release managers! Thanks everyone who has > made this release possible! > > Cheers, > Zhu > > Piotr Nowojski

Re: [Flink-SQL] FLOORing OR CEILing a DATE or TIMESTAMP to WEEK uses Thursdays as week start

2021-03-04 Thread Leonard Xu
s suggested in one of the > Calcite discussions. > > The changes proposed by FLIP-126 definitely look good. I'll check its details > further. > > Best Regards, > > On Thu, 4 Mar 2021 at 04:18, Leonard Xu <mailto:xbjt...@gmail.com>> wrote: > Hi, Sebastiá

Re: flink sql中如何使用异步io关联维表?

2021-03-04 Thread Leonard Xu
目前Flink SQL 中的connector都没实现异步io关联维表,接口是上已经支持了的,如果是自己实现可以参考[1] 另外,HBase connector 社区有人正在支持异步io关联维表,预计1.13可以使用[2] 祝好

Re: [DISCUSS] Deprecation and removal of the legacy SQL planner

2021-03-04 Thread Leonard Xu
+1 for the roadmap. Thanks Timo for driving this. Best, Leonard > 在 2021年3月4日,20:40,Timo Walther 写道: > > Last call for feedback on this topic. > > It seems everyone agrees to finally complete FLIP-32. Since FLIP-32 has been > accepted for a very long time, I think we don't need another

Re: [DISCUSS] Deprecation and removal of the legacy SQL planner

2021-03-04 Thread Leonard Xu
+1 for the roadmap. Thanks Timo for driving this. Best, Leonard > 在 2021年3月4日,20:40,Timo Walther 写道: > > Last call for feedback on this topic. > > It seems everyone agrees to finally complete FLIP-32. Since FLIP-32 has been > accepted for a very long time, I think we don't need another

Re: Processing-time temporal join is not supported yet.

2021-03-04 Thread Leonard Xu
mars 2021 à 05:31, Leonard Xu <mailto:xbjt...@gmail.com>> a écrit : > Hi, Eric > >> what will be the best workaround to enrich stream of data from a kafka >> topics with statical data based on id? > Currently you can put your statical data in Hive/JDBC/HBase whi

Re: Processing-time temporal join is not supported yet.

2021-03-03 Thread Leonard Xu
the s3 files that can be used to enrich your stream data. Best, Leonard > > > Le sam. 27 févr. 2021 à 05:15, Leonard Xu <mailto:xbjt...@gmail.com>> a écrit : > Hi, Eric > > Firstly FileSystemTableSource doe not implement LookupTableSource which means > we canno

Re: [Flink-SQL] FLOORing OR CEILing a DATE or TIMESTAMP to WEEK uses Thursdays as week start

2021-03-03 Thread Leonard Xu
the patch, what we need is only to adapt it in Flink code, I’d like to make this as a part of FLIP-162 and fix it soon. Thanks Julian and Timo for the reminder. Best, Leonard > 在 2021年3月4日,12:14,Leonard Xu 写道: > > Hi, Jaffe > > Flink follows old version calcite’s behav

Re: [Flink-SQL] FLOORing OR CEILing a DATE or TIMESTAMP to WEEK uses Thursdays as week start

2021-03-03 Thread Leonard Xu
Hi, Jaffe Flink follows old version calcite’s behaviour which lead to the wrong behavior. snd Julian is right that calcite has corrected FLOOR and CEIL functions in CALCITE-3412, Flink has upgraded calcite to 1.26 version which contains the patch, what we need is only to adapt it in Flink

Re: Processing-time temporal join is not supported yet.

2021-02-26 Thread Leonard Xu
Hi, Eric Firstly FileSystemTableSource doe not implement LookupTableSource which means we cannot directly lookup a Filesystem table. In FLINK-19830, we plan to support Processing-time temporal join any table/views by lookup the data in join operator state which scanned from the filesystem

Re: Flink SQL temporal table join with Hive 报错

2021-02-19 Thread Leonard Xu
> > 二,维表有有分区,每个分区仅仅包含当天的数据,没有 primary key > > 这种情况因为要 Join 全部的数据,所以还是需要设置 'streaming-source.partition.include' = > 'all',但是还是因为没有 primary Key,所以无法 run。 > > 现在就是针对第二种情况,因为Hive的维度表不是我维护的,很多人都在用,所以不能修改去加上 primary key,无法进行 join. 第二种情况,hive表不是streaming读的,相当于是一张静态表,每次都是加载最新的全量,所以配置如下参数即可

Re: Flink SQL temporal table join with Hive 报错

2021-02-09 Thread Leonard Xu
Hi, macia > 在 2021年2月9日,10:40,macia kk 写道: > > SELECT *FROM >( >SELECT tt.* >FROM >input_tabe_01 tt >FULL OUTER JOIN input_tabe_02 mt >ON (mt.transaction_sn = tt.reference_id) >and tt.create_time >= mt.create_time + INTERVAL

Re: Flink SQL Hive 使用 partition.include 结果跟文档不一致

2021-02-04 Thread Leonard Xu
Hi > 在 2021年2月5日,09:47,macia kk 写道: > > the `latest` only works` when the > streaming hive source table used as temporal table. 只能用在temporal(时态)表中,时态表只能在 temporal join(也就是我们常说的维表join) 中使用 祝好

Re: 是否可以 hive 流 join hive 流?

2021-01-31 Thread Leonard Xu
还没有,你可以关注下这个issue[1] 祝好, Leonard [1] https://issues.apache.org/jira/browse/FLINK-21183 > 在 2021年2月1日,13:29,macdoor 写道: > > 当前的 1.13-snapshot 支持了吗?我可以试试吗? > > > > -- > Sent from: http://apache-flink.147419.n8.nabble.com/

Re: 是否可以 hive 流 join hive 流?

2021-01-31 Thread Leonard Xu
Okay, 和我理解的一样,这个时间上是 event time, 基于event time的 interval join 需要定义watermark,目前hive表还不支持定义watermark,1.13应该会支持。 > 在 2021年2月1日,10:58,macdoor 写道: > > p1.time 是数据记录里的时间,也用这个时间做分区 > > > > -- > Sent from: http://apache-flink.147419.n8.nabble.com/

Re: flink sql时区问题

2021-01-31 Thread Leonard Xu
嗯,flink 中 很多时间函数比如PROCTIME()/CURRENT_TIMESTAMP 返回的值都是 UTC+0的时间值,这里的timezone设置对这些函数不生效的,这些函数是有点时区问题的, 目前只能在代码里通过加减时区偏移绕过。 > 在 2021年2月1日,10:50,沉醉寒風 <1039601...@qq.com> 写道: > > 在代码中这样设置 streamTableEnv.getConfig().setLocalTimeZone(ZoneId.of("+8")) > 也不管用. 还是要自己手动去加减时间才能做到,方法比较笨, > > > > >

Re: flink sql时区问题

2021-01-31 Thread Leonard Xu
Hi, 时区不生效在你的代码中是体现在那些地方呀?目前flink sql是有些时区问题,社区也希望在1.13能解决掉。 > 在 2021年2月1日,10:42,沉醉寒風 <1039601...@qq.com> 写道: > > streamTableEnv.getConfig().setLocalTimeZone(ZoneId.of("+8"))

Re: 是否可以 hive 流 join hive 流?

2021-01-31 Thread Leonard Xu
Hi,macdoor 很有意思的case,p1.time字段是你记录里的时间吗? 你hive表的分区字段和这个时间字段的关系是怎么样的呀? > 在 2021年1月30日,17:54,macdoor 写道: > > 具体需求是这样,采集取得的通道总流量5分钟一次存入 hive 表,为了取得 5 分钟内该通道的流量,需要前后2次采集到的总流量相减,我想用同一个 hive > 表自己相互 join,形成 2 个 hive 流 join,不知道是否可以实现?或者有其他实现方法吗? > 我现在使用 crontab 定时 batch 模式做,希望能改成 stream 模式 > >

Re: 咨询求助

2021-01-31 Thread Leonard Xu
> 在 2021年1月31日,20:15,Appleyuchi 写道: > > 一点小小的建议哈, > 目前flink社区讨论主要还是java/scala为主, > 如果执意使用pyflink的话,后续极有可能会遇到较大的阻力. 我理解这种较大阻力应该不存在的,社区里pyflink的投入还挺大的,蛮多开发者的,我也cc两位在这块做贡献的社区开发者,从JIRA上看pyflink相关的开发进度都挺快的。 如果有机器学习,python相关的经验,用pyflink我觉得挺合适的。 祝好, Leonard

Re: 退订

2021-01-24 Thread Leonard Xu
Hi 需要取消订阅邮件, 可以发送任意内容的邮件到 user-zh-unsubscr...@flink.apache.org 取消订阅来自 user-zh@flink.apache.org 邮件列表的邮件 邮件列表的订阅管理,请参考[1] 祝好, Leonard [1] https://flink.apache.org/community.html#how-to-subscribe-to-a-mailing-list >

Re: Flink sql去重问题

2021-01-24 Thread Leonard Xu
Hello 特殊的Top-N是说去重的语义是Top 1, 所以只用保留一个大小的堆,其底层实现和其他Top-N的数据结构不一样,并不需要维护一个堆, 其他的数据根据语义 要么被丢掉,要么撤回下发新值,另外这种有状态的算子,数据都是放在state里的,设置的TTL是生效的,表示state中的数据有效期时多久,这个数据会用来判断新来的数据是丢掉还是撤回旧值并下发新的值。 祝好, Leonard > 在 2021年1月22日,10:53,guaishushu1...@163.com 写道: > > >

[DISCUSS] FLIP-162: Consistent Flink SQL time function behavior

2021-01-21 Thread Leonard Xu
Hello, everyone I want to start the discussion of FLIP-162: Consistent Flink SQL time function behavior[1]. We’ve some initial discussion of several problematic functions in dev mail list[2], and I think it's the right time to resolve them by a FLIP. Currently some time function behaviors

[DISCUSS] FLIP-162: Consistent Flink SQL time function behavior

2021-01-21 Thread Leonard Xu
Hello, everyone I want to start the discussion of FLIP-162: Consistent Flink SQL time function behavior[1]. We’ve some initial discussion of several problematic functions in dev mail list[2], and I think it's the right time to resolve them by a FLIP. Currently some time function behaviors

Re: [DISCUSS] Correct time-related function behavior in Flink SQL

2021-01-21 Thread Leonard Xu
> If use the default Flink SQL, the window time range of the >> statistics is incorrect, then the statistical results will naturally be >> incorrect. To zhisheng, sorry to hear that this problem influenced your production jobs, Could you share your SQL pattern? we can have more inputs a

Re: [DISCUSS] Correct time-related function behavior in Flink SQL

2021-01-21 Thread Leonard Xu
> If use the default Flink SQL, the window time range of the >> statistics is incorrect, then the statistical results will naturally be >> incorrect. To zhisheng, sorry to hear that this problem influenced your production jobs, Could you share your SQL pattern? we can have more inputs a

Re: Flink SQL kafka connector有办法获取到partition、offset信息嘛?

2021-01-21 Thread Leonard Xu
> 看了下,是1.12才开始支持么,1.11是不行的嘛? 是的,1.11不支持,文档也是有版本的,如果对应版本的文档里没有该功能介绍,那就是不支持的。

Re: Pyflink Join with versioned view / table

2021-01-19 Thread Leonard Xu
Hi, Torben Happy to hear you address your problem, the first option can resolve the situation that partial partitions of the Kafka topic did not receive data, but if all partitions didn’t receive data, the watermark won’t be pushed forward, and the temporal join won’t be triggered.

Re: Flink sql interval join problem

2021-01-16 Thread Leonard Xu
Hi, >I only saw inner interval join on the official website, I don't see > outer interval join on the offical website, Is there an example of an OUTER > INTERVAL JOIN? >official website >

Re: Pushing Down Filters

2021-01-16 Thread Leonard Xu
Hi, Shekhar > 1. Optimizer does not use both - ProjectableTableSource and > FilterableTableSource - in a single query even if the source implements both > interfaces. Each interface works correctly if implemented independently. I didn’t see your custom source implementation, but I think the

Re: Pushing Down Filters

2021-01-16 Thread Leonard Xu
Hi, Shekhar > 1. Optimizer does not use both - ProjectableTableSource and > FilterableTableSource - in a single query even if the source implements both > interfaces. Each interface works correctly if implemented independently. I didn’t your custom source implementation, but I think the two

Re: Pyflink Join with versioned view / table

2021-01-16 Thread Leonard Xu
Hi, Torben > When implementing the join I get only updates when the right table changes The event-time temporal join versioned table is triggered watermark which calculated by both left and right table’s watermark, so you get only updated when the right table changes(which is the slower one

Re: Publishing a table to Kafka

2021-01-15 Thread Leonard Xu
Hi, Rai > What are my options to still write to Kafka? I don't mind introducing > another boolean/etc field in the Kafka output records containing the > row kind or similar info. The recommended way is use `upset-kafka`[1] connector which you can write insert/update/retract message to a

Re: 【Flink SQL】维表优化规则建议

2021-01-10 Thread Leonard Xu
Hi, 这个异常信息可以提升的准确说是需要主键和even-time 时间属性,你的自定义维表是同时支持lookup和scan的吗? 这个异常信息可以提升的,如果确定问题的话可以再社区建个JIRA提升下的。 祝好 Leonard Xu > 在 2021年1月9日,09:39,张韩 写道: > > 版本:1.12 > 问题:维表关联若是支持事件时间,维表需要有主键和时间属性,在满足这两个条件前提下,自定义维表若是实现LookupTableSource接口则优化会报异常: > Caused by: org.apache.calcite.pla

Re: flink-sql流平台工具

2020-12-29 Thread Leonard Xu
感谢分享! 看起来很nice的平台化实践,star 了. > 在 2020年12月29日,21:09,zhp <499348...@qq.com> 写道: > > 本人业余时间开发了一个基于flink-sql 的web 可视化ui平台供大家学习、参考、使用 > https://github.com/zhp8341/flink-streaming-platform-web > > > > > -- > Sent from:

Re: flink1.12支持hbase1.2吗

2020-12-29 Thread Leonard Xu
Hi, hbase-1.2社区没测试过,社区支持的是hbase-1.4.x 和 hbase-2.3.x, 你可以用hbase-1.4.x的connector试下,connector使用到Hbase的API不多,1.4.x 和 1.2.x 应该是兼容的 祝好, Leonard > 在 2020年12月29日,21:12,zhp <499348...@qq.com> 写道: > > flink1.12支持hbase1.2吗 > > > > -- > Sent from: http://apache-flink.147419.n8.nabble.com/

Re: table rowtime timezome problem

2020-12-27 Thread Leonard Xu
Hi,Jiazhi > When DataStream is converted to table, eventTime is converted to > rowTime. Rowtime is 8 hours slow. How to solve this problem? The reason is that the only data type that used to define an event time in Table/SQL is TIMESTAMP(3), and TIMESTAMP type isn’t related to your

Re: pyflink1.12 使用connector read.query参数报错

2020-12-24 Thread Leonard Xu
Hi, 嘉伟 1.12 应该不支持 read.query, 社区还在讨论是否要开放这个,有些concern, 简单的讲,就如你这个query写的,创建的这张JDBC 表应该是一个 View 而不是对应一张JDBC 表,同时这个表只能用来作为source,不能用来作为sink。 祝好, Leonard > 在 2020年12月24日,19:16,冯嘉伟 <1425385...@qq.com> 写道: > > hi! 试试这个 > > CREATE TABLE source_table( >yldrate DECIMAL, >

Re: Flink SQL continuous join checkpointing

2020-12-22 Thread Leonard Xu
Hi, Taras > But checkpoint data size for join task is permanently increasing despite the > watermarks on the tables and "Low watermark" mark in UI. > As far as I understand outdated records from both tables must be dropped from > checkpoint after 2 hours, but looks like it holds all job state

Re: Flink-1.12支持kafka join jdbc维表吗

2020-12-20 Thread Leonard Xu
维护放在state里,在运行时每条数据去和state中的数据关联。 祝好 Leonard > > > > > 发件人: Leonard Xu > 发送时间: 2020-12-21 14:44 > 收件人: user-zh > 主题: Re: Flink-1.12支持kafka join jdbc维表吗 > Hi >> 在给jdbc声明主键和watermark后,使用官网的事件时间join语法,任务启动后发现jdbc算子一次性读取了所有jdbc维表数据,状态变成了finished > > 这是正

Re: Flink-1.12支持kafka join jdbc维表吗

2020-12-20 Thread Leonard Xu
Hi > 在给jdbc声明主键和watermark后,使用官网的事件时间join语法,任务启动后发现jdbc算子一次性读取了所有jdbc维表数据,状态变成了finished 这是正常的,jdbc connector实现的表就是bounded的,只会scan一次,一次读完,之后数据库表的数据更新是没有去捕捉的,connector也没有很好的办法去实时监控数据库表的更新并广播到下游节点。 如果想要有获取实时更新的维表并做基于event time语义的维表关联,那么推荐的方式就是接入数据库表的binlog(changelog), 用主流去 temporal join

Re: Pyflink1.12尝试连接oracle数据,报错findAndCreateTableSource failed

2020-12-16 Thread Leonard Xu
目前 JDBC connector 只支持 MySQL, Pg和Derby(一般测试用)这几种dialect, Oracle还不支持。 祝好, Leonard > 在 2020年12月17日,09:47,肖越 <18242988...@163.com> 写道: > > pyflink小白,测试pyflink1.12功能,想通过定义connector从oracle数据库中获取数据 > 通过如下方式定义: > env = StreamExecutionEnvironment.get_execution_environment() > env.set_parallelism(1) >

Re: upsert-kafka to do temporal table joins

2020-12-16 Thread Leonard Xu
Hi, guoliubin Please ignore my previous answer, I mixed your question with an another one, I post the right temporal join sql syntax here. SELECT [column_list] FROM table1 [AS ] [LEFT] JOIN table2 FOR SYSTEM_TIME AS OF table1.{ proctime | rowtime } [AS ] ON table1.column-name1 =

Re: upsert-kafka to do temporal table joins

2020-12-16 Thread Leonard Xu
Hi, guoliubin Sorry for the late reply, I think the example in release note has a minor typo error which missed the ‘AS’ keyword. SELECT o.order_id, o.order_time, o.amount * r.currency_rate AS amount, r.currency FROM orders AS o, latest_rates FOR SYSTEM_TIME AS OF o.order_time

Re: [ANNOUNCE] Apache Flink 1.12.0 released

2020-12-10 Thread Leonard Xu
Thanks Dian and Robert for the great work as release manager ! And thanks everyone who makes the release possible ! Best, Leonard > 在 2020年12月10日,20:17,Robert Metzger 写道: > > The Apache Flink community is very happy to announce the release of Apache > Flink 1.12.0, which is the latest

Re: A group window expects a time attribute for grouping in a stream environment谢谢

2020-12-10 Thread Leonard Xu
k-docs-master/zh/dev/event_time.html> > - > 昨天的完整代码是: > https://paste.ubuntu.com/p/9JsFDKC5V8/ > > > ~!!! > > > > > > > > > > > > 在 2020-12-10 12:02:31,"Leonard Xu"

Re: flink jdbc connector 在checkpoint的时候如何确保buffer中的数据全都sink到数据库

2020-12-09 Thread Leonard Xu
你们分析是对的,这是个bug,这里应该用SinkFunctionProvider, 用GenericJdbcSinkFunction再wrap一层,不用OutputFormatProvider,因为OutputFormatSinkFunction没有继承CheckpointedFunction, 没法保证在cp时将buffer数据刷到数据库, 也可以说是OutputFormat不会参与cp, 所以at-least-once都不一定能保证。 修复应该很简单的,@jie mei 你有兴趣帮忙修复吗? 祝好, Leonard > 在 2020年12月10日,11:22,jie

Re: A group window expects a time attribute for grouping in a stream environment谢谢

2020-12-09 Thread Leonard Xu
Hi, 补充下昨天线下提供的答疑,在从datastream 转换到Table时,如果希望转换后的Table上能够继续使用watermark, 需要(1)让datastream中包含watermark (2)在table上声明event time 属性. 文档可以参考[1] 给出文档中省略的watermark生成部分code: // 老版本 //Table orders = tEnv.fromDataStream(orderA.assignTimestampsAndWatermarks(new AscendingTimestampExtractor()

Re: how to register TableAggregateFunction?

2020-12-08 Thread Leonard Xu
Hi, appleyuchi Sorry for the late reply, but could you describe you problem more or post your exception stack? The doc you posted has contained the section to define and register function. And I suggest you post your entire code in email directly that can reproduce the problem, thus the

Re: FlinkSQL中创建表,视图等一些元数据信息都是存放在什么地方(没看到像Hive那样使用mysql存储元数据信息)

2020-12-07 Thread Leonard Xu
Hi, Flink 的元数据存放在catalog中的,也支持多种catalog(embedded, HIve,JDBC,自定义catalog),默认Flink使用内置的GenericInMemoryCatalog,这个是in memory的catalog,元数据都在这里,生产环境上可以使用HiveCatalog 祝好 Leonard [1] https://ci.apache.org/projects/flink/flink-docs-release-1.12/zh/dev/table/catalogs.html

Re: ScanTableSource 为什么不支持SupportsFilterPushDown的问题

2020-12-07 Thread Leonard Xu
Hi, 在1.11中,planner 并没有支持下表中的各种PushDown, 所以这里做了check,这是planner层面不支持的。在1.12里,planner层面已经支持了这些PushDown,所以这些check都没有了,用户可以自定义 connector 并实现各种PushDown,比如,1.12中已经支持了kafka source上的watermarkPushdown。 因此,有这类需求建议基于1.12开发。 祝好, Leonard > > Hi: > 由于业务需要,我想在flink1.11.2中自定义一个ScanTableSource,

Re: flink 使用关系型数据库的默认事务是否可以做到端对端的精确一次,还是需要实现2p2提交

2020-12-07 Thread Leonard Xu
> 你的意思是 自己实现sink 提交的过程中抛出所有异常并且rollback,是可以做到端对端精确一次的; 不是,我是在回答你Flink 在写入关系数据库是可以实现端到端一致的,需要的方式需要实现两阶段提交,这个思路是可行的。你说的简单地回滚是没法保证exactly-once语义的。 > hdxg1101300...@163.com > > 发件人: Leonard Xu > 发送时间: 2020-12-07 17:00 > 收件人: user-zh > 主题: Re: flink 使用关系型数据库的默认事务是否可以做到端对端的

Re: flink sql实时计算UpsertStreamTableSink requires that Table has a full primary keys if it is updated

2020-12-07 Thread Leonard Xu
Hi, 你是不是没有订阅flink的用户邮件列表,所以有些邮件你看不到。 你可以发送任意内容的邮件到user-zh-subscr...@flink.apache.org <mailto:user-zh-subscr...@flink.apache.org> 即可订阅用户邮件列表,订阅后邮件列表里大家的提问和回答你都可以看见了。 [1] https://flink.apache.org/zh/community.html > 在 2020年12月7日,16:50,Leonard Xu 写道: > > Hi, > >>

Re: flink 使用关系型数据库的默认事务是否可以做到端对端的精确一次,还是需要实现2p2提交

2020-12-07 Thread Leonard Xu
Hi, > 在 2020年12月7日,16:46,hdxg1101300...@163.com 写道: > >flink 使用关系型数据库的默认事务是否可以做到端对端的精确一次,还是需要实现2p2提交; >自己实现sink开启数据库事务,遇到错误回滚并抛出异常,是否可以实现数据精确一次 Flink 写入关系型数据库是可以做到端到端的一致性的,默认是不支持的,需要实现两阶段提交,按照你的思路是可行的。另外社区也有人在做这个feature[1],已经有PR了,你可以参考,预计会在1.13里支持。 祝好, Leonard [1]

Re: flink sql实时计算UpsertStreamTableSink requires that Table has a full primary keys if it is updated

2020-12-07 Thread Leonard Xu
Hi, > 在 2020年12月7日,16:41,爱成绕指柔 <1194803...@qq.com> 写道: > > Exception in thread "main" org.apache.flink.table.api.TableException: > UpsertStreamTableSink requires that Table has a full primary keys if it is > updated. 这个错误是在query 没法推断出主键,而 hbase sink 是一个upsert sink, 需要PK来实现upsert语义。

Re: flinksql1.11长时间没有数据写入mysql,会报ava.sql.SQLException: No operations allowed after statement closed.

2020-12-02 Thread Leonard Xu
Hi,yanzi 可以贴下完整的报错信息吗? 祝好, Leonard Xu > 在 2020年12月3日,10:36,yanzi 写道: > > 使用flinksql 1.11版本,运行计算好的指标落入mysql,长时间没有数据会报错,导致任务会失败。 > 针对:https://issues.apache.org/jira/browse/FLINK-16681,已经修复此问题,但是我们使用1.11最新版本,运行一段时间后,发现还是会有此问题,如何解决 > > > > -- > Sent from: ht

Re: Join a datastream with tables stored in Hive

2020-12-01 Thread Leonard Xu
Hi, Krzysztof > * I have a high pace stream of events coming in Kafka. > * I have some dimension tables stored in Hive. These tables are changed > daily. I can keep a snapshot for each day. For this use case, Flink supports temporal join the latest hive partition as temporal table now,

Re: Join a datastream with tables stored in Hive

2020-12-01 Thread Leonard Xu
Hi, Maciej > > I didn't find a SQL solution to this problem. > Now Flink provides the SQL solution, you can see the doc[1], the Flink-1.12 document link that posted by Chesnay should have updated but not..., I’ll check the document of 1.12. Best, Leonard [1]

Re: 【Flink SQL】无法启动 env.yaml

2020-12-01 Thread Leonard Xu
Hi, 李轲 这是因为yml只支持1.10之前老的connector,写法是connector.type=‘filesystem’, 1.11之后的新connector都是 connetor=‘filesystem’, 除了简化了写法外,前者的工厂方法和后者的也不一样, 所以通过yml定义的新的connector是不能被老的工厂 SPI 发现的。而在yml中定义表从1.11开始就是不推荐了,因为已经支持了用DDL这种纯SQL的方式定义表。 推荐你可以拉起sql-client后,用DDL的方式建表 祝好 Leonard > 在 2020年12月1日,21:43,李轲 写道:

Re: 分组查询时,select的字段是否一定要都在group by中吗?

2020-11-30 Thread Leonard Xu
Hi, bulterman 你的分析是对的,group by pk的query是可以优化到筛选全部列的,这可以是个优化点,只是flink 现在还没有做, 和 Flink pk的 NOT ENFORCED 并没有关系,NOT NEOFRCED是说Flink不持有数据,不像数据库持有数据可以在读取时做校验。 个人感觉这是个小的优化点,如果很急需可以考虑在社区开个issue. 祝好, Leonard Xu > 在 2020年12月1日,13:40,bulterman <15618338...@163.com> 写道: > > Hi ALL, >

<    1   2   3   4   5   6   >