You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Dennis Gove (JIRA)" <ji...@apache.org> on 2015/12/28 04:49:49 UTC

[jira] [Commented] (SOLR-8458) Parameter substitution for Streaming Expressions

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

Dennis Gove commented on SOLR-8458:
-----------------------------------

What if we were to make substitution parameters first class citizens similar to named parameters? During the parsing in ExpressionParser we could create instances of StreamExpressionSubstitutionParameters which exist as first class citizens of an StreamExpression object. This would allow us to send (in the example in the description) "expr", "left", and "right" through the ExpressionParser. Then, a simple method can be added to the StreamFactory which accepts a main expression and a map of names => expressions. It could then iterate over parameters of the main expression doing replacements until there are no more instances of StreamExpressionSubstitutionParameter in the main expression. Some checks for infinite loops would have to be added but those are relatively simple. 

This approach would allow the logic to exist outside of the StreamHandler which I think would be beneficial for the SQL Handler. 

It might also allow for some type of prepared statements with "pre-compiled" pieces (similar to what one might see in a DBMS). For example, this might be beneficial in a situation where some very expensive part of the expression is static which you want to perform different rollups or joins or whatever with. An optimizer could hang onto the static results in a RepeatableStream (doesn't exist yet) and substitute that into some other expression.

> Parameter substitution for Streaming Expressions
> ------------------------------------------------
>
>                 Key: SOLR-8458
>                 URL: https://issues.apache.org/jira/browse/SOLR-8458
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Joel Bernstein
>            Priority: Minor
>         Attachments: SOLR-8458.patch
>
>
> As Streaming Expressions become more complicated it would be nice to support parameter substitution. For example:
> {code}
> http://localhost:8983/col/stream?expr=merge($left, $right, ...)&left=search(...)&right=search(...)
> {code}



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

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