[jira] [Comment Edited] (SOLR-9916) Add arithmetic operations to the SelectStream

2017-01-05 Thread Dennis Gove (JIRA)

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

Dennis Gove edited comment on SOLR-9916 at 1/6/17 1:45 AM:
---

Of course. sum is a metric.


was (Author: dpgove):
Oh jeez. Of course. sum is a metric.

> Add arithmetic operations to the SelectStream
> -
>
> Key: SOLR-9916
> URL: https://issues.apache.org/jira/browse/SOLR-9916
> Project: Solr
>  Issue Type: New Feature
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Joel Bernstein
>
> One of the things that will be needed as the SQL implementation matures is 
> the ability to do arithmetic operations. For example:
> select (a+b) from x;
> select sum(a)+sum(b) from x;
> We will need to support arithmetic operations within the Streaming API to 
> support these types of operations.
> It looks like adding arithmetic operations to the SelectStream is the best 
> place to add this functionality.



--
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



[jira] [Comment Edited] (SOLR-9916) Add arithmetic operations to the SelectStream

2017-01-05 Thread Joel Bernstein (JIRA)

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

Joel Bernstein edited comment on SOLR-9916 at 1/6/17 1:44 AM:
--

Here is the full expression:

{code}
having(rollup(over=a_f, 
  sum(a_i), 
  search(collection1 q=*:*, fl="id,a_s,a_i,a_f", sort="a_f asc")), 
   eq(sum(a_i), 9)))

{code}

So the "sum(a_i)" is the field in the tuples produced by the rollup.


was (Author: joel.bernstein):
Here is the full expression:

{code}
having(rollup(over=a_f, 
  sum(a_i), 
  search(collection1 q=*:*, fl="id,a_s,a_i,a_f", sort="a_f asc")), 
   eq(sum(a_i), 9)))

{code}

So the having is 

> Add arithmetic operations to the SelectStream
> -
>
> Key: SOLR-9916
> URL: https://issues.apache.org/jira/browse/SOLR-9916
> Project: Solr
>  Issue Type: New Feature
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Joel Bernstein
>
> One of the things that will be needed as the SQL implementation matures is 
> the ability to do arithmetic operations. For example:
> select (a+b) from x;
> select sum(a)+sum(b) from x;
> We will need to support arithmetic operations within the Streaming API to 
> support these types of operations.
> It looks like adding arithmetic operations to the SelectStream is the best 
> place to add this functionality.



--
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



[jira] [Comment Edited] (SOLR-9916) Add arithmetic operations to the SelectStream

2017-01-05 Thread Joel Bernstein (JIRA)

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

Joel Bernstein edited comment on SOLR-9916 at 1/6/17 1:43 AM:
--

Here is the full expression:

{code}
having(rollup(over=a_f, 
  sum(a_i), 
  search(collection1 q=*:*, fl="id,a_s,a_i,a_f", sort="a_f asc")), 
   eq(sum(a_i), 9)))

{code}

So the having is 


was (Author: joel.bernstein):
Here is the full expression:

{code}
having(rollup(over=a_f, 
 sum(a_i), 
 search(collection1 q=*:*, fl="id,a_s,a_i,a_f", sort="a_f asc")), 
  eq(sum(a_i), 9)))");

{code}

So the having is 

> Add arithmetic operations to the SelectStream
> -
>
> Key: SOLR-9916
> URL: https://issues.apache.org/jira/browse/SOLR-9916
> Project: Solr
>  Issue Type: New Feature
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Joel Bernstein
>
> One of the things that will be needed as the SQL implementation matures is 
> the ability to do arithmetic operations. For example:
> select (a+b) from x;
> select sum(a)+sum(b) from x;
> We will need to support arithmetic operations within the Streaming API to 
> support these types of operations.
> It looks like adding arithmetic operations to the SelectStream is the best 
> place to add this functionality.



--
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



[jira] [Comment Edited] (SOLR-9916) Add arithmetic operations to the SelectStream

2017-01-05 Thread Joel Bernstein (JIRA)

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

Joel Bernstein edited comment on SOLR-9916 at 1/6/17 1:43 AM:
--

Here is the full expression:

{code}
having(rollup(over=a_f, 
 sum(a_i), 
 search(collection1 q=*:*, fl="id,a_s,a_i,a_f", sort="a_f asc")), 
  eq(sum(a_i), 9)))");

{code}

So the having is 


was (Author: joel.bernstein):
Here is the full expression:

{code}
having(rollup(over=a_f, 
 sum(a_i), 
 search(collection1 q=*:*, fl="id,a_s,a_i,a_f", sort="a_f 
asc")), 
 eq(sum(a_i), 9)))");

{code}

So the having is 

> Add arithmetic operations to the SelectStream
> -
>
> Key: SOLR-9916
> URL: https://issues.apache.org/jira/browse/SOLR-9916
> Project: Solr
>  Issue Type: New Feature
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Joel Bernstein
>
> One of the things that will be needed as the SQL implementation matures is 
> the ability to do arithmetic operations. For example:
> select (a+b) from x;
> select sum(a)+sum(b) from x;
> We will need to support arithmetic operations within the Streaming API to 
> support these types of operations.
> It looks like adding arithmetic operations to the SelectStream is the best 
> place to add this functionality.



--
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



[jira] [Comment Edited] (SOLR-9916) Add arithmetic operations to the SelectStream

2017-01-05 Thread Joel Bernstein (JIRA)

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

Joel Bernstein edited comment on SOLR-9916 at 1/6/17 1:31 AM:
--

Looks really good to me. Having the ability to nest the different types of 
operations with conditional logic in the select stream is really powerful.

I'm just about to commit a small change so that LeafOperations can accept a 
metric identifier without single quotes. Currently you have to do the following 
or the parser will parse the metric and not know how to use it as a value 
operand.

{code}
having(expr, eq('sum(a_i)', 9))
{code}

After this small commit it will support:

{code}
having(expr, eq(sum(a_i), 9))
{code}

This will just be relevant for Solr 6.4 which is coming in a few days.

The work you're doing on this ticket will supersede this change but it's nice 
to have for 6.4.





was (Author: joel.bernstein):
Looks really good to me.

I'm just about to commit a small change so that LeafOperations can accept a 
metric identifier without single quotes. Currently you have to do the following 
or the parser will parse the metric and not know how to use it as a value 
operand.

{code}
having(expr, eq('sum(a_i)', 9))
{code}

After this small commit it will support:

{code}
having(expr, eq(sum(a_i), 9))
{code}

This will just be relevant for Solr 6.4 which is coming in a few days.

The work you're doing on this ticket will supersede this change but it's nice 
to have for 6.4.




> Add arithmetic operations to the SelectStream
> -
>
> Key: SOLR-9916
> URL: https://issues.apache.org/jira/browse/SOLR-9916
> Project: Solr
>  Issue Type: New Feature
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Joel Bernstein
>
> One of the things that will be needed as the SQL implementation matures is 
> the ability to do arithmetic operations. For example:
> select (a+b) from x;
> select sum(a)+sum(b) from x;
> We will need to support arithmetic operations within the Streaming API to 
> support these types of operations.
> It looks like adding arithmetic operations to the SelectStream is the best 
> place to add this functionality.



--
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



[jira] [Comment Edited] (SOLR-9916) Add arithmetic operations to the SelectStream

2017-01-05 Thread Dennis Gove (JIRA)

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

Dennis Gove edited comment on SOLR-9916 at 1/6/17 12:01 AM:


I'm going to start implementing these as Operations. I'll be sure to support 
the cases of operations within operations like
{code}
plus(div(a,replace(b,null,0)),c)
{code}


was (Author: dpgove):
I'm going to start implementing these as Operations.

> Add arithmetic operations to the SelectStream
> -
>
> Key: SOLR-9916
> URL: https://issues.apache.org/jira/browse/SOLR-9916
> Project: Solr
>  Issue Type: New Feature
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Joel Bernstein
>
> One of the things that will be needed as the SQL implementation matures is 
> the ability to do arithmetic operations. For example:
> select (a+b) from x;
> select sum(a)+sum(b) from x;
> We will need to support arithmetic operations within the Streaming API to 
> support these types of operations.
> It looks like adding arithmetic operations to the SelectStream is the best 
> place to add this functionality.



--
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



[jira] [Comment Edited] (SOLR-9916) Add arithmetic operations to the SelectStream

2017-01-05 Thread Dennis Gove (JIRA)

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

Dennis Gove edited comment on SOLR-9916 at 1/5/17 11:59 PM:


I'm going to start implementing these as Operations.


was (Author: dpgove):
I'mm going to start implementing these as Operations.

> Add arithmetic operations to the SelectStream
> -
>
> Key: SOLR-9916
> URL: https://issues.apache.org/jira/browse/SOLR-9916
> Project: Solr
>  Issue Type: New Feature
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Joel Bernstein
>
> One of the things that will be needed as the SQL implementation matures is 
> the ability to do arithmetic operations. For example:
> select (a+b) from x;
> select sum(a)+sum(b) from x;
> We will need to support arithmetic operations within the Streaming API to 
> support these types of operations.
> It looks like adding arithmetic operations to the SelectStream is the best 
> place to add this functionality.



--
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



[jira] [Comment Edited] (SOLR-9916) Add arithmetic operations to the SelectStream

2017-01-05 Thread Dennis Gove (JIRA)

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

Dennis Gove edited comment on SOLR-9916 at 1/5/17 11:59 PM:


I think this is a good idea. 

Select already supports an "as" concept, so something like would be possible 
already
{code}
select(plus(a,b) as outfield, )
{code}


was (Author: dpgove):
I think this is a good idea. 

Select already supports an "as" concept, so something like would be possible 
already
{code}
select(add(a,b) as outfield, )
{code}

> Add arithmetic operations to the SelectStream
> -
>
> Key: SOLR-9916
> URL: https://issues.apache.org/jira/browse/SOLR-9916
> Project: Solr
>  Issue Type: New Feature
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Joel Bernstein
>
> One of the things that will be needed as the SQL implementation matures is 
> the ability to do arithmetic operations. For example:
> select (a+b) from x;
> select sum(a)+sum(b) from x;
> We will need to support arithmetic operations within the Streaming API to 
> support these types of operations.
> It looks like adding arithmetic operations to the SelectStream is the best 
> place to add this functionality.



--
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



[jira] [Comment Edited] (SOLR-9916) Add arithmetic operations for the SelectStream

2017-01-03 Thread Joel Bernstein (JIRA)

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

Joel Bernstein edited comment on SOLR-9916 at 1/3/17 4:58 PM:
--

One possible approach would look like this:

{code}
plus(a, b, outField)
plus(plus(a,b), c, outField)
plus(sum(a), sum(b), outField)
{code}

In the first example two field names are used to represent operands.

In the second example the first operand is a nested arithmetic operation. 

In the third example the operands are aggregate function names.

The constructors of the arithmetic operations will need to do the work to 
distinguish the different types of operands.

As part of a select expression it would like this:
{code}
select(expr, plus(a,b, outField), minus(sum(a), sum(b), outField))
{code}


For simplicity arithmetic functions can only return doubles.

Suggested initial arithmetic operations:

plus
minus,
mult,
div,
abs,
mod












was (Author: joel.bernstein):
One possible approach would look like this:

{code}
plus(a, b, outField)
plus(plus(a,b), c, outField)
plus(sum(a), sum(b), outField)
{code}

In the first example two field names are used to represent operands.

In the second example the first operand is a nested arithmetic operation. 

In the third example the operands are aggregate function names.

The constructors of the arithmetic operations will need to do the work to 
distinguish the different types of operands.

For simplicity arithmetic functions can only return doubles.

Suggested initial arithmetic operations:

plus
minus,
mult,
div,
abs,
mod











> Add arithmetic operations for the SelectStream
> --
>
> Key: SOLR-9916
> URL: https://issues.apache.org/jira/browse/SOLR-9916
> Project: Solr
>  Issue Type: New Feature
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Joel Bernstein
>
> One of the things that will be needed as the SQL implementation matures is 
> the ability to do arithmetic operations. For example:
> select (a+b) from x;
> select sum(a)+sum(b) from x;
> We will need to support arithmetic operations within the Streaming API to 
> support these types of operations.
> It looks like adding arithmetic operations to the SelectStream is the best 
> place to add this functionality.



--
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



[jira] [Comment Edited] (SOLR-9916) Add arithmetic operations for the SelectStream

2017-01-03 Thread Joel Bernstein (JIRA)

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

Joel Bernstein edited comment on SOLR-9916 at 1/3/17 4:55 PM:
--

One possible approach would look like this:

{code}
plus(a, b, outField)
plus(plus(a,b), c, outField)
plus(sum(a), sum(b), outField)
{code}

In the first example two field names are used to represent operands.

In the second example the first operand is a nested arithmetic operation. 

In the third example the operands are aggregate function names.

The constructors of the arithmetic operations will need to do the work to 
distinguish the different types of operands.

For simplicity arithmetic functions can only return doubles.

Suggested initial arithmetic operations:

plus
minus,
mult,
div,
abs,
mod












was (Author: joel.bernstein):
One possible approach would like this:

{code}
plus(a, b, outField)
plus(plus(a,b), c, outField)
plus(sum(a), sum(b), outField)
{code}

In the first example two field names are used to represent operands.

In the second example the first operand is a nested arithmetic operation. 

In the third example the operands are aggregate function names.

The constructors of the arithmetic operations will need to do the work to 
distinguish the different types of operands.

For simplicity arithmetic functions can only return doubles.

Suggested initial arithmetic operations:

plus
minus,
mult,
div,
abs,
mod











> Add arithmetic operations for the SelectStream
> --
>
> Key: SOLR-9916
> URL: https://issues.apache.org/jira/browse/SOLR-9916
> Project: Solr
>  Issue Type: New Feature
>  Security Level: Public(Default Security Level. Issues are Public) 
>Reporter: Joel Bernstein
>
> One of the things that will be needed as the SQL implementation matures is 
> the ability to do arithmetic operations. For example:
> select (a+b) from x;
> select sum(a)+sum(b) from x;
> We will need to support arithmetic operations within the Streaming API to 
> support these types of operations.
> It looks like adding arithmetic operations to the SelectStream is the best 
> place to add this functionality.



--
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