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

Joel Bernstein edited comment on SOLR-8593 at 7/15/16 2:53 AM:
---------------------------------------------------------------

Ah, I see. I think we can pull off CoGroup with a merge() and reduce().

{code}
reduce(merge(search(..., sort="a asc"),
             search(..., sort="a asc"),
             on="a asc")), 
       by="a", 
       group(sort="b asc", n="5")) 
{code}

This operation is more generic in that it could be an aggregation or a join 
depending on what comes after the reduce. 

Fun stuff.


was (Author: joel.bernstein):
Ah, I see. I think we can pull off CoGroup with a merge() and reduce().

{code}
reduce(merge(search(..., sort="a asc"),
             search(..., sort="a asc"),
             on="a asc")), 
       by="a", 
       group(sort="b asc", n="5")) 
{code}

This operation is more generic in that it could be an aggregation or a join 
depending what comes after the reduce. 

Fun stuff.

> Integrate Apache Calcite into the SQLHandler
> --------------------------------------------
>
>                 Key: SOLR-8593
>                 URL: https://issues.apache.org/jira/browse/SOLR-8593
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Joel Bernstein
>
> The Presto SQL Parser was perfect for phase one of the SQLHandler. It was 
> nicely split off from the larger Presto project and it did everything that 
> was needed for the initial implementation.
> Phase two of the SQL work though will require an optimizer. Here is where 
> Apache Calcite comes into play. It has a battle tested cost based optimizer 
> and has been integrated into Apache Drill and Hive.
> This work can begin in trunk following the 6.0 release. The final query plans 
> will continue to be translated to Streaming API objects (TupleStreams), so 
> continued work on the JDBC driver should plug in nicely with the Calcite work.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to