flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Flink Jira Bot (Jira)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-18909) SequenceGenerator doesn't work as expected
Date Wed, 14 Apr 2021 22:43:02 GMT

    [ https://issues.apache.org/jira/browse/FLINK-18909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17321368#comment-17321368
] 

Flink Jira Bot commented on FLINK-18909:
----------------------------------------

This issue and all of its Sub-Tasks have not been updated for 180 days. So, it has been labeled
"stale-minor". If you are still affected by this bug or are still interested in this issue,
please give an update and remove the label. In 7 days the issue will be closed automatically.

> SequenceGenerator doesn't work as expected
> ------------------------------------------
>
>                 Key: FLINK-18909
>                 URL: https://issues.apache.org/jira/browse/FLINK-18909
>             Project: Flink
>          Issue Type: Bug
>          Components: API / DataStream
>    Affects Versions: 1.11.1
>            Reporter: Alan
>            Priority: Minor
>              Labels: stale-minor
>
> When using a org.apache.flink.streaming.api.functions.source.datagen.SequenceGenerator
> with 0 and Long.MaxValue the following exception is rasied:
> <<snip>>
> new SequenceGenerator(0, Long.MAX_VALUE);
>  
> Caused by: java.lang.IllegalArgumentExceptionCaused by: java.lang.IllegalArgumentException
at org.apache.flink.util.Preconditions.checkArgument(Preconditions.java:123) at org.apache.flink.streaming.api.functions.source.datagen.SequenceGenerator.safeDivide(SequenceGenerator.java:110)
at org.apache.flink.streaming.api.functions.source.datagen.SequenceGenerator.open(SequenceGenerator.java:83)
at org.apache.flink.streaming.api.functions.source.datagen.DataGeneratorSource.initializeState(DataGeneratorSource.java:64)
>  
> This is because the Long overflows. in the check: 
> long totalNoOfElements = Math.abs(end - start + 1);
> Which is incorrect. - this code should use BigInteger.  
>  
> Using
> new SequenceGenerator(0, Long.MAX_VALUE-1);
> Still fails on the following check:
> Caused by: java.lang.IllegalArgumentExceptionCaused by: java.lang.IllegalArgumentException
at org.apache.flink.util.Preconditions.checkArgument(Preconditions.java:123) at org.apache.flink.streaming.api.functions.source.datagen.SequenceGenerator.safeDivide(SequenceGenerator.java:111)
at org.apache.flink.streaming.api.functions.source.datagen.SequenceGenerator.open(SequenceGenerator.java:83)
at org.apache.flink.streaming.api.functions.source.datagen.DataGeneratorSource.initializeState(DataGeneratorSource.java:64)
>  
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message