[jira] [Commented] (FLINK-13999) Correct the documentation of MATCH_RECOGNIZE

2019-10-14 Thread Dian Fu (Jira)


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

Dian Fu commented on FLINK-13999:
-

[~sunjincheng121] Thanks a lot! 
[~dwysakowicz] I have submitted the PR and looking forward to your review.

> Correct the documentation of MATCH_RECOGNIZE
> 
>
> Key: FLINK-13999
> URL: https://issues.apache.org/jira/browse/FLINK-13999
> Project: Flink
>  Issue Type: Bug
>  Components: Documentation
>Reporter: Dian Fu
>Assignee: Dian Fu
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Regarding to the following 
> [example|https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/streaming/match_recognize.html#aggregations]
>  in the doc:
> {code:java}
> SELECT *
> FROM Ticker
> MATCH_RECOGNIZE (
> PARTITION BY symbol
> ORDER BY rowtime
> MEASURES
> FIRST(A.rowtime) AS start_tstamp,
> LAST(A.rowtime) AS end_tstamp,
> AVG(A.price) AS avgPrice
> ONE ROW PER MATCH
> AFTER MATCH SKIP TO FIRST B
> PATTERN (A+ B)
> DEFINE
> A AS AVG(A.price) < 15
> ) MR;
> {code}
> Given the inputs shown in the doc, it should be:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5{code}
> instead of:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5
> ACME   01-APR-11 10:00:04  01-APR-11 10:00:09 13.5
> {code}



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


[jira] [Commented] (FLINK-13999) Correct the documentation of MATCH_RECOGNIZE

2019-10-14 Thread sunjincheng (Jira)


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

sunjincheng commented on FLINK-13999:
-

I have assign it to you [~dian.fu], Thank you!:)

> Correct the documentation of MATCH_RECOGNIZE
> 
>
> Key: FLINK-13999
> URL: https://issues.apache.org/jira/browse/FLINK-13999
> Project: Flink
>  Issue Type: Bug
>  Components: Documentation
>Reporter: Dian Fu
>Assignee: Dian Fu
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Regarding to the following 
> [example|https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/streaming/match_recognize.html#aggregations]
>  in the doc:
> {code:java}
> SELECT *
> FROM Ticker
> MATCH_RECOGNIZE (
> PARTITION BY symbol
> ORDER BY rowtime
> MEASURES
> FIRST(A.rowtime) AS start_tstamp,
> LAST(A.rowtime) AS end_tstamp,
> AVG(A.price) AS avgPrice
> ONE ROW PER MATCH
> AFTER MATCH SKIP TO FIRST B
> PATTERN (A+ B)
> DEFINE
> A AS AVG(A.price) < 15
> ) MR;
> {code}
> Given the inputs shown in the doc, it should be:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5{code}
> instead of:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5
> ACME   01-APR-11 10:00:04  01-APR-11 10:00:09 13.5
> {code}



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


[jira] [Commented] (FLINK-13999) Correct the documentation of MATCH_RECOGNIZE

2019-10-14 Thread Dian Fu (Jira)


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

Dian Fu commented on FLINK-13999:
-

[~dwysakowicz] Very sorry for late response. I'll submit a PR for this later 
today.

> Correct the documentation of MATCH_RECOGNIZE
> 
>
> Key: FLINK-13999
> URL: https://issues.apache.org/jira/browse/FLINK-13999
> Project: Flink
>  Issue Type: Bug
>  Components: Documentation
>Reporter: Dian Fu
>Priority: Major
>
> Regarding to the following 
> [example|https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/streaming/match_recognize.html#aggregations]
>  in the doc:
> {code:java}
> SELECT *
> FROM Ticker
> MATCH_RECOGNIZE (
> PARTITION BY symbol
> ORDER BY rowtime
> MEASURES
> FIRST(A.rowtime) AS start_tstamp,
> LAST(A.rowtime) AS end_tstamp,
> AVG(A.price) AS avgPrice
> ONE ROW PER MATCH
> AFTER MATCH SKIP TO FIRST B
> PATTERN (A+ B)
> DEFINE
> A AS AVG(A.price) < 15
> ) MR;
> {code}
> Given the inputs shown in the doc, it should be:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5{code}
> instead of:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5
> ACME   01-APR-11 10:00:04  01-APR-11 10:00:09 13.5
> {code}



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


[jira] [Commented] (FLINK-13999) Correct the documentation of MATCH_RECOGNIZE

2019-10-09 Thread Dawid Wysakowicz (Jira)


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

Dawid Wysakowicz commented on FLINK-13999:
--

I'm fine with any of the suggested values as long as the resulting avgPrice for 
the second row is different from the first one and it has a short fractional 
part.

> Correct the documentation of MATCH_RECOGNIZE
> 
>
> Key: FLINK-13999
> URL: https://issues.apache.org/jira/browse/FLINK-13999
> Project: Flink
>  Issue Type: Bug
>  Components: Documentation
>Reporter: Dian Fu
>Priority: Major
>
> Regarding to the following 
> [example|https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/streaming/match_recognize.html#aggregations]
>  in the doc:
> {code:java}
> SELECT *
> FROM Ticker
> MATCH_RECOGNIZE (
> PARTITION BY symbol
> ORDER BY rowtime
> MEASURES
> FIRST(A.rowtime) AS start_tstamp,
> LAST(A.rowtime) AS end_tstamp,
> AVG(A.price) AS avgPrice
> ONE ROW PER MATCH
> AFTER MATCH SKIP TO FIRST B
> PATTERN (A+ B)
> DEFINE
> A AS AVG(A.price) < 15
> ) MR;
> {code}
> Given the inputs shown in the doc, it should be:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5{code}
> instead of:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5
> ACME   01-APR-11 10:00:04  01-APR-11 10:00:09 13.5
> {code}



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


[jira] [Commented] (FLINK-13999) Correct the documentation of MATCH_RECOGNIZE

2019-10-07 Thread Dian Fu (Jira)


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

Dian Fu commented on FLINK-13999:
-

[~dwysakowicz] Thanks for the confirmation and suggestion! The suggested 
changes make sense to me. Regarding to the comment "change this value to have a 
nicer average in the result", the price of "28" of the new row is good enough 
for me given the average "14.0" is different from "14.5". Other good candidates 
could be "22", "25", etc and the average will be "13.0", "13.5", etc. What do 
you think?

> Correct the documentation of MATCH_RECOGNIZE
> 
>
> Key: FLINK-13999
> URL: https://issues.apache.org/jira/browse/FLINK-13999
> Project: Flink
>  Issue Type: Bug
>  Components: Documentation
>Reporter: Dian Fu
>Priority: Major
>
> Regarding to the following 
> [example|https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/streaming/match_recognize.html#aggregations]
>  in the doc:
> {code:java}
> SELECT *
> FROM Ticker
> MATCH_RECOGNIZE (
> PARTITION BY symbol
> ORDER BY rowtime
> MEASURES
> FIRST(A.rowtime) AS start_tstamp,
> LAST(A.rowtime) AS end_tstamp,
> AVG(A.price) AS avgPrice
> ONE ROW PER MATCH
> AFTER MATCH SKIP TO FIRST B
> PATTERN (A+ B)
> DEFINE
> A AS AVG(A.price) < 15
> ) MR;
> {code}
> Given the inputs shown in the doc, it should be:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5{code}
> instead of:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5
> ACME   01-APR-11 10:00:04  01-APR-11 10:00:09 13.5
> {code}



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


[jira] [Commented] (FLINK-13999) Correct the documentation of MATCH_RECOGNIZE

2019-10-07 Thread Dawid Wysakowicz (Jira)


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

Dawid Wysakowicz commented on FLINK-13999:
--

Hi, I had a bit more time to have a proper look at this problem. [~dian.fu] is 
right. It is an error in the example. The row with timestamp {{'01-Apr-11 
10:00:04'}} obviously cannot start a new match as it exceeds the average of 15 
(25/1 > 15).

I would suggest two changes to the example:
1. Change the skip strategy to the default {{AFTER MATCH SKIP PAST LAST ROW}}, 
as the strategy here is not important for the example.
2. Add a new at the end to get two output rows. I suggest to have:

input:
{code}
symbol rowtime pricetax
==    === ===
'ACME'  '01-Apr-11 10:00:00'   12  1
'ACME'  '01-Apr-11 10:00:01'   17  2
'ACME'  '01-Apr-11 10:00:02'   13  1
'ACME'  '01-Apr-11 10:00:03'   16  3
'ACME'  '01-Apr-11 10:00:04'   25  2
'ACME'  '01-Apr-11 10:00:05'   2   1
'ACME'  '01-Apr-11 10:00:06'   4   1
'ACME'  '01-Apr-11 10:00:07'   10  2
'ACME'  '01-Apr-11 10:00:08'   15  2
'ACME'  '01-Apr-11 10:00:09'   25  2
'ACME'  '01-Apr-11 10:00:10'   28 (change this value to have a nicer average in 
the result)  1
'ACME'  '01-Apr-11 10:00:11'   30  1
{code}

output:
{code}
 symbol   start_tstamp   end_tstamp  avgPrice
=  ==  ==  
ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5
ACME   01-APR-11 10:00:05  01-APR-11 10:00:10 14.0
{code}

> Correct the documentation of MATCH_RECOGNIZE
> 
>
> Key: FLINK-13999
> URL: https://issues.apache.org/jira/browse/FLINK-13999
> Project: Flink
>  Issue Type: Bug
>  Components: Documentation
>Reporter: Dian Fu
>Priority: Major
>
> Regarding to the following 
> [example|https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/streaming/match_recognize.html#aggregations]
>  in the doc:
> {code:java}
> SELECT *
> FROM Ticker
> MATCH_RECOGNIZE (
> PARTITION BY symbol
> ORDER BY rowtime
> MEASURES
> FIRST(A.rowtime) AS start_tstamp,
> LAST(A.rowtime) AS end_tstamp,
> AVG(A.price) AS avgPrice
> ONE ROW PER MATCH
> AFTER MATCH SKIP TO FIRST B
> PATTERN (A+ B)
> DEFINE
> A AS AVG(A.price) < 15
> ) MR;
> {code}
> Given the inputs shown in the doc, it should be:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5{code}
> instead of:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5
> ACME   01-APR-11 10:00:04  01-APR-11 10:00:09 13.5
> {code}



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


[jira] [Commented] (FLINK-13999) Correct the documentation of MATCH_RECOGNIZE

2019-09-16 Thread Aljoscha Krettek (Jira)


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

Aljoscha Krettek commented on FLINK-13999:
--

I quickly talked to [~dawidwys] about this, he mentioned that it might be a bug 
and not a documentation glitch. We'll get back once we know more.

> Correct the documentation of MATCH_RECOGNIZE
> 
>
> Key: FLINK-13999
> URL: https://issues.apache.org/jira/browse/FLINK-13999
> Project: Flink
>  Issue Type: Bug
>  Components: Documentation
>Reporter: Dian Fu
>Priority: Major
>
> Regarding to the following [example|#aggregations]] in the doc:
> {code:java}
> SELECT *
> FROM Ticker
> MATCH_RECOGNIZE (
> PARTITION BY symbol
> ORDER BY rowtime
> MEASURES
> FIRST(A.rowtime) AS start_tstamp,
> LAST(A.rowtime) AS end_tstamp,
> AVG(A.price) AS avgPrice
> ONE ROW PER MATCH
> AFTER MATCH SKIP TO FIRST B
> PATTERN (A+ B)
> DEFINE
> A AS AVG(A.price) < 15
> ) MR;
> {code}
> Given the inputs shown in the doc, it should be:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5{code}
> instead of:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5
> ACME   01-APR-11 10:00:04  01-APR-11 10:00:09 13.5
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (FLINK-13999) Correct the documentation of MATCH_RECOGNIZE

2019-09-06 Thread Dian Fu (Jira)


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

Dian Fu commented on FLINK-13999:
-

This issue is reported in the user list: 
[http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Wrong-result-of-MATCH-RECOGNIZE-clause-td29820.html]
 

> Correct the documentation of MATCH_RECOGNIZE
> 
>
> Key: FLINK-13999
> URL: https://issues.apache.org/jira/browse/FLINK-13999
> Project: Flink
>  Issue Type: Bug
>  Components: Documentation
>Reporter: Dian Fu
>Priority: Major
>
> Regarding to the following 
> [example|[https://ci.apache.org/projects/flink/flink-docs-stable/dev/table/streaming/match_recognize.html#aggregations]]
>  in the doc:
> {code:java}
> SELECT *
> FROM Ticker
> MATCH_RECOGNIZE (
> PARTITION BY symbol
> ORDER BY rowtime
> MEASURES
> FIRST(A.rowtime) AS start_tstamp,
> LAST(A.rowtime) AS end_tstamp,
> AVG(A.price) AS avgPrice
> ONE ROW PER MATCH
> AFTER MATCH SKIP TO FIRST B
> PATTERN (A+ B)
> DEFINE
> A AS AVG(A.price) < 15
> ) MR;
> {code}
> Given the inputs shown in the doc, it should be:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME 01-APR-11 10:00:00 01-APR-11 10:00:03 14.5{code}
> instead of:
> {code:java}
>  symbol   start_tstamp   end_tstamp  avgPrice
> =  ==  ==  
> ACME   01-APR-11 10:00:00  01-APR-11 10:00:03 14.5
> ACME   01-APR-11 10:00:04  01-APR-11 10:00:09 13.5
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)