Re: 使用Flink1.10.0读取hive时source并行度问题

2020-03-05 文章 Bowen Li
@JingsongLee  把当前的hive sink并发度配置策略加到文档里吧
https://issues.apache.org/jira/browse/FLINK-16448

On Tue, Mar 3, 2020 at 9:31 PM Jun Zhang <825875...@qq.com> wrote:

>
> 嗯嗯,其实我觉得我写的这个示例sql应该是一个使用很广泛的sql,我新建了hive表,并且导入了数据之后,一般都会使用类似的sql来验证一下表建的对不对,数据是否正确。
>
>
>
>
>
>
>  在2020年03月4日 13:25,JingsongLee
>   Hi jun,
>
>
> Jira: https://issues.apache.org/jira/browse/FLINK-16413
> FYI
>
>
> Best,
> Jingsong Lee
>
>
> --
> From:JingsongLee  Send Time:2020年3月3日(星期二) 19:06
> To:Jun Zhang <825875...@qq.com; user-zh@flink.apache.org <
> user-zh@flink.apache.org
> Cc:user-zh@flink.apache.org  likeg...@163.com
> Subject:Re: 使用Flink1.10.0读取hive时source并行度问题
>
>
> Hi jun,
>
> 很好的建议~ 这是一个优化点~ 可以建一个JIRA
>
> Best,
> Jingsong Lee
>
>
> --
> From:Jun Zhang <825875...@qq.com
> Send Time:2020年3月3日(星期二) 18:45
> To:user-zh@flink.apache.org  lzljs3620...@aliyun.com
> Cc:user-zh@flink.apache.org  likeg...@163.com
> Subject:回复: 使用Flink1.10.0读取hive时source并行度问题
>
>
> 
> hi,jinsong:
> 我想说一个问题, 我开始了自动推断,比如我设置推断的最大并行度是10,
> 我有一个类似的sql select * from mytable limit 1;
> hive表mytable有超过10个文件,如果启动了10个并行度是不是有点浪费呢。
> 在2020年03月2日 16:38,JingsongLee 写道: 建议使用Batch模式来读取Hive table。
>
> Best,
> Jingsong Lee
>
>
> --
> From:like  Send Time:2020年3月2日(星期一) 16:35
> To:lzljs3620...@aliyun.com  Subject:回复: 使用Flink1.10.0读取hive时source并行度问题
>
>
> 我使用的是 StreamTableEnvironment,确实有碰到这个问题呢。
> 在2020年3月2日 16:16,JingsongLee 自动推断可能面临资源不足无法启动的问题
>
> 理论上不应该呀?Batch作业是可以部分运行的。
>
> Best,
> Jingsong Lee
>
> --
> From:like  Send Time:2020年3月2日(星期一) 15:35
> To:user-zh@flink.apache.org  lzljs3620...@aliyun.com  Subject:回复: 使用Flink1.10.0读取hive时source并行度问题
>
>
> 非常感谢!我尝试关闭自动推断后,已经可以控制source并行度了,自动推断可能面临资源不足无法启动的问题。
>
>
> 在2020年3月2日 15:18,JingsongLee 写道: Hi,
>
> 1.10中,Hive source是自动推断并发的,你可以使用以下参数配置到flink-conf.yaml里面来控制并发:
> - table.exec.hive.infer-source-parallelism=true (默认使用自动推断)
> - table.exec.hive.infer-source-parallelism.max=1000 (自动推断的最大并发)
>
> Sink的并发默认和上游的并发相同,如果有Shuffle,使用配置的统一并发。
>
> Best,
> Jingsong Lee
>
>
> --
> From:like  Send Time:2020年3月2日(星期一) 14:58
> To:user-zh@flink.apache.org  Subject:使用Flink1.10.0读取hive时source并行度问题
>
> hi,大家好
>
> 我使用flink1.10.0读取hive表,启动时设置了全局的并行度,但是在读取的时候,发现sink并行度是受约束的,
>
> 而source的并行度不受此约束,会根据source的大小改变,大的时候并行度大到1000,请问一下怎么处理这个并行度呢?


Re: How to test flink job recover from checkpoint

2020-03-05 文章 Bajaj, Abhinav
I implemented a custom function that throws up a runtime exception.

You can extend from simpler MapFunction or more complicated 
RichParallelSourceFunction depending on your use case.
You can add logic to throw a runtime exception on a certain condition in the 
map or run method.   .
You can use a count or timer to trigger the exception.

Sharing a quick handwritten example.

DataStream stream = .
DataStream mappedStream = stream.map(new MapFunction>() 
{
  @Override
  public String map(String value) throws Exception {
if (SOME_CONDITION) {
  throw new RuntimeException("Lets test checkpointing");
}
return value;
  }
});

~ Abhinav Bajaj


From: Eleanore Jin 
Date: Wednesday, March 4, 2020 at 4:40 PM
To: user , user-zh 
Subject: How to test flink job recover from checkpoint

Hi,

I have a flink application and checkpoint is enabled, I am running locally 
using miniCluster.

I just wonder if there is a way to simulate the failure, and verify that flink 
job restarts from checkpoint?

Thanks a lot!
Eleanore