apache / apache/beam

BeamSQL Pattern Recognization Functionality

Open
#20,299 0 comments 2 reactions 0 assignees View on GitHub
dsl mentor new feature P3 sql
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

The goal of this Jira is to support the following syntax in BeamSQL:

```

SELECT T.aid, T.bid, T.cid
FROM MyTable
MATCH_RECOGNIZE (
PARTITION BY userid
ORDER
BY proctime
MEASURES
A.id AS aid,
B.id AS bid,
C.id AS cid

PATTERN (A B C)
DEFINE
A AS name = 'a',
B AS name = 'b',
C AS name
= 'c'
) AS T

```

match_recognize is in SQL standard 2016. Currently Calcite also supports it. A good reference to match_recognize is [1]

This will requires touch core components of BeamSQL:
1. SQL parser to support the syntax above.
2. SQL core to implement physical relational operator.
3. Distributed algorithms to implement a list of functions in a distributed manner.

other references:
Calcite match_recognize syntax [2]

[1]: https://ci.apache.org/projects/flink/flink-docs-stable/dev/table/streaming/match_recognize.html
[2]: https://calcite.apache.org/docs/reference.html#syntax-1

Imported from Jira [BEAM-9543](https://issues.apache.org/jira/browse/BEAM-9543). Original Jira may contain additional context.
Reported by: amaliujia.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.