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

Milinda Lakmal Pathirage commented on SAMZA-483:
------------------------------------------------

>From Streaming SQL object model, I am thinking about something similar to 
>following (we can go for a more generic version, below is just an idea what it 
>will be like):

public class SelectQuery {
    private FromClause fromClause;
    private WhereCaluse whereCaluse;

    public void setFromClause(FromClause fromClause) {
        this.fromClause = fromClause;
    }

    public void setWhereCaluse(WhereCaluse whereCaluse) {
        this.whereCaluse = whereCaluse;
    }
}

In case of relational algebra it will be something like this:

/ Recursive data structure
public class RelExpr {
    // This can be a subquery, window operation, etc.
    private RelExpr operand1;
    private RelExpr operand2;
    private BinaryOp binaryOp;
    private SelectionClause selection;
    private ProjectionClause projection;
    private WindowClause window;

    // In case the relational algebra expression reduced to a reference (stream 
or relation)
    private String identifier;
    
    // TODO: We have to add join conditions, partition by clauses as well.
}

Above models are not final and are just for demonstration purposes only.

> A common representation of relational algebra for streaming SQL 
> ----------------------------------------------------------------
>
>                 Key: SAMZA-483
>                 URL: https://issues.apache.org/jira/browse/SAMZA-483
>             Project: Samza
>          Issue Type: Sub-task
>            Reporter: Yi Pan (Data Infrastructure)
>            Priority: Minor
>              Labels: project
>
> Per discussion with [~criccomini] and [~milinda], we agreed that it seems to 
> be a good idea to define a common representation of relational algebra on top 
> of the operators defined in the operator layer (see SAMZA-482), which can be 
> the common base that we can use to generate the description/configuration of 
> a Samza job.
> This common layer can also be used by DSL-like language parser as a result of 
> parsing a DSL program.
> Some additional requirements needed in addition to pure relational algebra:
> 1) the common representation should include window operators and stream 
> operators (i.e. IStream/DStream/RStream)
> 2) the common representation should include description on parallelism of the 
> jobs (i.e. how many partitions the resultant Samza job will use)
> Some references:
> http://web.cs.wpi.edu/~mukherab/i/DCAPE.pdf
> https://cs.uwaterloo.ca/~david/cs848/stream-cql.pdf
> http://davis.wpi.edu/dsrg/PROJECTS/CAPE/publications.htm
> http://davis.wpi.edu/dsrg/PROJECTS/CAPE/slides.htm



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to