itinycheng / flink-connector-clickhouse

Flink SQL connector for ClickHouse. Support ClickHouseCatalog and read/write primary data, maps, arrays to clickhouse.
Apache License 2.0
374 stars 156 forks source link

use-local #58

Closed weitianpei closed 1 year ago

weitianpei commented 2 years ago

请问作者,use-local能够再解释的清楚一点吗? 根据你的描述,说的是在分布式引擎表情况下,是否直接读或者写本地表。

itinycheng commented 2 years ago

请问作者,use-local能够再解释的清楚一点吗? 根据你的描述,说的是在分布式引擎表情况下,是否直接读或者写本地表。

就是你说的意思,use-local = true情况下: Read:会生成select from local_table的SQL读本地表(配合读分片策略,内部根据设置的并行度自适应的策略); Write:会生成insert into local_table的SQL写本地表(配合sharding配置策略);

weitianpei commented 2 years ago

如果我的表名为分布式表,你这边能找到我对应的本地表吗?

---Original--- From: @.> Date: Wed, Oct 26, 2022 15:01 PM To: @.>; Cc: @.**@.>; Subject: Re: [itinycheng/flink-connector-clickhouse] use-local (Issue #58)

请问作者,use-local能够再解释的清楚一点吗? 根据你的描述,说的是在分布式引擎表情况下,是否直接读或者写本地表。

就是你说的意思,use-local = true情况下: Read:会生成select from local_table的SQL读本地表(配合读分片策略,内部根据设置的并行度自适应的策略); Write:会生成insert into local_table的SQL写本地表(配合sharding配置策略);

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

itinycheng commented 1 year ago

如果我的表名为分布式表,你这边能找到我对应的本地表吗?

@weitianpei 会通过解析分布式表的engine_full信息来获取对应的local表相关信息;

weitianpei commented 1 year ago

感谢你的作品,给我们带来了便利

---Original--- From: @.> Date: Wed, Nov 30, 2022 16:53 PM To: @.>; Cc: @.**@.>; Subject: Re: [itinycheng/flink-connector-clickhouse] use-local (Issue #58)

如果我的表名为分布式表,你这边能找到我对应的本地表吗?

@weitianpei 会通过解析分布式表的engine_full信息来获取对应的local表相关信息;

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

itinycheng commented 1 year ago

@weitianpei 🤝 Welcome to raise issue/PR

weitianpei commented 1 year ago

未来flink官方能嵌入clickhouse connector吗?

---Original--- From: @.> Date: Wed, Nov 30, 2022 17:22 PM To: @.>; Cc: @.**@.>; Subject: Re: [itinycheng/flink-connector-clickhouse] use-local (Issue #58)

Closed #58 as completed.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

weitianpei commented 1 year ago

亲爱的作者: 您好,非常感谢你提供这么好用的执行器。 这里想请教一下: sink.ignore-delete sink.update-strategy

这两个是什么意思呢?

天天 @.***

 

------------------ 原始邮件 ------------------ 发件人: "天天" @.>; 发送时间: 2022年12月9日(星期五) 晚上6:45 @*.**@*.>; @.>; 主题: Re: [itinycheng/flink-connector-clickhouse] use-local (Issue #58)

未来flink官方能嵌入clickhouse connector吗?

---Original--- From: @.> Date: Wed, Nov 30, 2022 17:22 PM To: @.>; Cc: @.**@.>; Subject: Re: [itinycheng/flink-connector-clickhouse] use-local (Issue #58)

Closed #58 as completed.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

itinycheng commented 1 year ago

sink.ignore-delete = false 不忽略RowKind.DELETE类型的数据,会将数据转化为Alter table delete ..语句,反之忽略; sink.update-strategy 是针对RowKind.UPDATE_AFTER数据的,将其转为insert, update语句,或是直接discard不做任何操作;

weitianpei commented 1 year ago

谢谢作者,很棒噢

---Original--- From: @.> Date: Wed, Apr 26, 2023 20:45 PM To: @.>; Cc: @.**@.>; Subject: Re: [itinycheng/flink-connector-clickhouse] use-local (Issue #58)

sink.ignore-delete = false 不忽略RowKind.DELETE类型的数据,会将数据转化为Alter table delete ..语句,反之忽略; sink.update-strategy 是针对RowKind.UPDATE_AFTER数据的,将其转为insert, update语句,或是直接discard不做任何操作;

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

weitianpei commented 1 year ago

亲爱的作者,我们在使用这个执行器的时候 我们使用的模式用哪种好呢,是流模式还是批处理模式呢。

2023年4月26日 20:45,moon0705 @.***> 写道:

sink.ignore-delete = false 不忽略RowKind.DELETE类型的数据,会将数据转化为Alter table delete ..语句,反之忽略; sink.update-strategy 是针对RowKind.UPDATE_AFTER数据的,将其转为insert, update语句,或是直接discard不做任何操作;

— Reply to this email directly, view it on GitHub https://github.com/itinycheng/flink-connector-clickhouse/issues/58#issuecomment-1523359764, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHH2Q2TEL2VLCSZ35R4XG5DXDEKGNANCNFSM6AAAAAAROUNNTM. You are receiving this because you were mentioned.

itinycheng commented 1 year ago

亲爱的作者,我们在使用这个执行器的时候 我们使用的模式用哪种好呢,是流模式还是批处理模式呢。 2023年4月26日 20:45,moon0705 @.***> 写道: sink.ignore-delete = false 不忽略RowKind.DELETE类型的数据,会将数据转化为Alter table delete ..语句,反之忽略; sink.update-strategy 是针对RowKind.UPDATE_AFTER数据的,将其转为insert, update语句,或是直接discard不做任何操作; — Reply to this email directly, view it on GitHub <#58 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHH2Q2TEL2VLCSZ35R4XG5DXDEKGNANCNFSM6AAAAAAROUNNTM. You are receiving this because you were mentioned.

这个只是个connector,对流/批无感知的,根据自己的业务需求选择即可;

weitianpei commented 1 year ago

谢谢你,真的太棒了,为大家提供了这么好用的代码

---Original--- From: @.> Date: Thu, Apr 27, 2023 17:03 PM To: @.>; Cc: @.**@.>; Subject: Re: [itinycheng/flink-connector-clickhouse] use-local (Issue #58)

亲爱的作者,我们在使用这个执行器的时候 我们使用的模式用哪种好呢,是流模式还是批处理模式呢。 … 2023年4月26日 20:45,moon0705 @.***> 写道: sink.ignore-delete = false 不忽略RowKind.DELETE类型的数据,会将数据转化为Alter table delete ..语句,反之忽略; sink.update-strategy 是针对RowKind.UPDATE_AFTER数据的,将其转为insert, update语句,或是直接discard不做任何操作; — Reply to this email directly, view it on GitHub <#58 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHH2Q2TEL2VLCSZ35R4XG5DXDEKGNANCNFSM6AAAAAAROUNNTM. You are receiving this because you were mentioned.

这个只是个connector,对流/批无感知的,根据自己的业务需求选择即可;

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

weitianpei commented 1 year ago

亲爱的tiancheng:

请问一下,如下方所示: 如果我这里分区为10. 那我这边是不是有10个jdbc连接去访问clickhouse呢? 目前有办法读到clickhouse底层数据吗?

2023年4月27日 17:03,moon0705 @.***> 写道:

亲爱的作者,我们在使用这个执行器的时候 我们使用的模式用哪种好呢,是流模式还是批处理模式呢。 … <x-msg://4/#> 2023年4月26日 20:45,moon0705 @.***> 写道: sink.ignore-delete = false 不忽略RowKind.DELETE类型的数据,会将数据转化为Alter table delete ..语句,反之忽略; sink.update-strategy 是针对RowKind.UPDATE_AFTER数据的,将其转为insert, update语句,或是直接discard不做任何操作; — Reply to this email directly, view it on GitHub <#58 (comment) https://github.com/itinycheng/flink-connector-clickhouse/issues/58#issuecomment-1523359764>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHH2Q2TEL2VLCSZ35R4XG5DXDEKGNANCNFSM6AAAAAAROUNNTM https://github.com/notifications/unsubscribe-auth/AHH2Q2TEL2VLCSZ35R4XG5DXDEKGNANCNFSM6AAAAAAROUNNTM. You are receiving this because you were mentioned.

这个只是个connector,对流/批无感知的,根据自己的业务需求选择即可;

— Reply to this email directly, view it on GitHub https://github.com/itinycheng/flink-connector-clickhouse/issues/58#issuecomment-1525194228, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHH2Q2XZYKUH7QMKUV6UZB3XDIY45ANCNFSM6AAAAAAROUNNTM. You are receiving this because you were mentioned.

weitianpei commented 1 year ago

亲爱的tinycheng:

请问以下红圈内的用法,是针对我们写clickhouse sink.write-local=true的时候,才使用的吧。 image

顺便问一下,你是叫魏天诚吗,跟我是本家啊

2023年4月27日 17:03,moon0705 @.***> 写道:

亲爱的作者,我们在使用这个执行器的时候 我们使用的模式用哪种好呢,是流模式还是批处理模式呢。 … <x-msg://1/#> 2023年4月26日 20:45,moon0705 @.***> 写道: sink.ignore-delete = false 不忽略RowKind.DELETE类型的数据,会将数据转化为Alter table delete ..语句,反之忽略; sink.update-strategy 是针对RowKind.UPDATE_AFTER数据的,将其转为insert, update语句,或是直接discard不做任何操作; — Reply to this email directly, view it on GitHub <#58 (comment) https://github.com/itinycheng/flink-connector-clickhouse/issues/58#issuecomment-1523359764>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHH2Q2TEL2VLCSZ35R4XG5DXDEKGNANCNFSM6AAAAAAROUNNTM https://github.com/notifications/unsubscribe-auth/AHH2Q2TEL2VLCSZ35R4XG5DXDEKGNANCNFSM6AAAAAAROUNNTM. You are receiving this because you were mentioned.

这个只是个connector,对流/批无感知的,根据自己的业务需求选择即可;

— Reply to this email directly, view it on GitHub https://github.com/itinycheng/flink-connector-clickhouse/issues/58#issuecomment-1525194228, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHH2Q2XZYKUH7QMKUV6UZB3XDIY45ANCNFSM6AAAAAAROUNNTM. You are receiving this because you were mentioned.

weitianpei commented 1 year ago

image

itinycheng commented 1 year ago

@weitianpei 您好像认错人了;

  1. partition相关配置确实是在use-local = true时才有效的;
  2. use-local = true情况下每个sink/source的subTask会和表的所有shard建立链接,随机链接到shard的一个replica;
weitianpei commented 1 year ago

不好意思,我认错人了。哈哈哈

现在有这样一个场景,我的分布式表有个字段是vin,hash键用的hash(vin) 想问,我们如果写local表,那么指定hash的方式也是hash vin. 那么两种不同方式写入结果的分布会一样吗