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

Stamatis Zampetakis commented on CALCITE-3122:
----------------------------------------------

Hi [~khaitran], regarding the discussion about {{RelOptCluster.planner}} I am 
not sure I understand why do you need a new planner but let me try to give you 
a few tips:

* If you use a {{HepPlanner}} then I think you won't get the error that nodes 
belong to a different planner so if your transformations are not cost-based you 
could use this planner;
* I suppose you could also use the same planner but with a different ruleset;
* There are cases where you don't really need a rule but just a shuttle/visitor 
that does trivial replacements over the plan (I am not sure if it this approach 
would work for you);  

Other than that copying nodes between clusters is very useful feature so we 
could try to finalize the PR in CALCITE-1681. 


> Convert Pig Latin scripts into Calcite logical plan 
> ----------------------------------------------------
>
>                 Key: CALCITE-3122
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3122
>             Project: Calcite
>          Issue Type: New Feature
>          Components: core, piglet
>            Reporter: Khai Tran
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> We create an internal Calcite repo at LinkedIn and develop APIs to parse any 
> Pig Latin scripts into Calcite logical plan. The code was tested in nearly 
> ~1000 Pig scripts written at LinkedIn.
> Changes:
> 1. piglet: main conversion code live there, include:
>  * APIs to convert any Pig scripts into RelNode plans or SQL statements
>  * Use Pig Grunt parser to parse Pig Latin scripts into Pig logical plan 
> (DAGs)
>  * Convert Pig schemas into RelDatatype
>  * Traverse through Pig expression plan and convert Pig expressions into 
> RexNodes
>  * Map some basic Pig UDFs to Calcite SQL operators
>  * Build Calcite UDFs for any other Pig UDFs, including UDFs written in both 
> Java and Python
>  * Traverse (DFS) through Pig logical plans to convert each Pig logical nodes 
> to RelNodes
>  * Have an optimizer rule to optimize Pig group/cogroup into Aggregate 
> operators
> 2. core:
>  * Implement other RelNode in Rel2Sql so that Pig can be translated into SQL
>  * Other minor changes in a few other classes to make Pig to Calcite works



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to