[jira] [Commented] (SOLR-8002) Field aliases support for SQL queries

2015-09-09 Thread Joel Bernstein (JIRA)

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

Joel Bernstein commented on SOLR-8002:
--

Actually the SQLHandler serializes to a StreamingExpression when the Streaming 
API objects are sent to worker nodes. As general rule I think that *all* 
built-in Solr features that use the Streaming API should serialize to 
StreamingExpressions for parallel operations, because it's extremely efficient.




> Field aliases support for SQL queries
> -
>
> Key: SOLR-8002
> URL: https://issues.apache.org/jira/browse/SOLR-8002
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Affects Versions: Trunk
>Reporter: Susheel Kumar
>
> Currently field aliases are not supported for SQL queries against SQL 
> Handler. E.g. below SQL query
>  select id,name as product_name from techproducts limit 20
> currently fails as data returned contains still "name" as the field/column 
> key than product_name



--
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] [Commented] (SOLR-8002) Field aliases support for SQL queries

2015-09-09 Thread Joel Bernstein (JIRA)

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

Joel Bernstein commented on SOLR-8002:
--

[~susheel2...@gmail.com], this ticket is actually pretty tricky to get started 
with, especially because SOLR-7903 is very close to being committed. Once 
SOLR-7903 is committed it will also need field alias support.

My gut feeling is that it would be more effective to work on SOLR-7986. The 
other nice things about working on the JDBC driver is that it will provide 
another set of overlapping tests of the SQLHandler going into the Solr 6 
release.

> Field aliases support for SQL queries
> -
>
> Key: SOLR-8002
> URL: https://issues.apache.org/jira/browse/SOLR-8002
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Affects Versions: Trunk
>Reporter: Susheel Kumar
>
> Currently field aliases are not supported for SQL queries against SQL 
> Handler. E.g. below SQL query
>  select id,name as product_name from techproducts limit 20
> currently fails as data returned contains still "name" as the field/column 
> key than product_name



--
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] [Commented] (SOLR-8002) Field aliases support for SQL queries

2015-09-09 Thread Joel Bernstein (JIRA)

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

Joel Bernstein commented on SOLR-8002:
--

Ah, just read your post more closely. Building up a Streaming Expression first 
rather then going directly to the Streaming API object is an interesting 
approach that I hadn't thought of. I'll take a look at how the SQLHandler is 
doing things and see what that would look like building up a Streaming 
Expression directly.

> Field aliases support for SQL queries
> -
>
> Key: SOLR-8002
> URL: https://issues.apache.org/jira/browse/SOLR-8002
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Affects Versions: Trunk
>Reporter: Susheel Kumar
>
> Currently field aliases are not supported for SQL queries against SQL 
> Handler. E.g. below SQL query
>  select id,name as product_name from techproducts limit 20
> currently fails as data returned contains still "name" as the field/column 
> key than product_name



--
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] [Commented] (SOLR-8002) Field aliases support for SQL queries

2015-09-09 Thread Dennis Gove (JIRA)

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

Dennis Gove commented on SOLR-8002:
---

Before I give my thoughts on this I do want to just put into writing an 
important note that I think will help frame the conversation.  

None of the Streaming classes require the use of streaming expressions. 
Streaming Expressions is just a way to turn a human readable expression into 
valid streaming constructs. You can, if you want, just create instances of 
streaming classes without ever thinking about expressions. The SQL api (in 
SQLHandler.java) currently works this way.

That said, I do feel that expressions are the easiest and clearest way to 
interact with Streams. They provide a very concrete yet expressive way to turn 
a streaming query into objects that do all the actual work. And they are 
bi-directional in that you can turn a set of stream objects into an expression 
as easily as you can turn an expression into a set of stream objects. From a 
user's perspective I find expressions easier to understand than even standard 
Solr queries, particularly when performing things like aggregations, top, and 
joins. I can look at an expression and know exactly what I should expect to 
receive as a result.

I'm not adverse to the your suggestion that we create a pipeline of SQL 
Statement -> Expression -> Stream object. That said, I don't think it would be 
good idea (from a performance perspective) to create a streaming expression in 
string format. Ie, "SELECT fieldA FROM collection1 WHERE fieldB = 1" -> 
search(collection1, fl="fieldA", q="fieldB:1"). I would instead suggest that we 
turn a SQL statement into a StreamExpression object. This would remove the need 
to reparse a string just to end up with a StreamExpression object. For example, 
the above SQL statement could be turned into a StreamExpression with the code
{code}
  StreamExpression expression = new StreamExpression("search")
  .withParameter(new StreamExpressionValue("collection1"))
  .withParameter(new StreamExpressionNamedParameter("fl","fieldA"))
  .withParameter(new StreamExpressionNamedParameter("q","fieldB:1"));
{code}
which can then be turned into a Stream with
{code}
  TupleStream stream = streamFactory.constructStream(expression);
{code}

Thinking about this wrt the string representation of an expression, we really 
end up with a rather clear pipeline of [SQL Statement | String Expression] -> 
StreamExpression -> TupleStream. This pipeline makes it very clear that 
whatever your input format is you only need to convert it into a 
StreamExpression object and that's it - all the other work of creating a stream 
from a StreamExpression object is already done. 

I think this is the correct approach.

> Field aliases support for SQL queries
> -
>
> Key: SOLR-8002
> URL: https://issues.apache.org/jira/browse/SOLR-8002
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Affects Versions: Trunk
>Reporter: Susheel Kumar
>
> Currently field aliases are not supported for SQL queries against SQL 
> Handler. E.g. below SQL query
>  select id,name as product_name from techproducts limit 20
> currently fails as data returned contains still "name" as the field/column 
> key than product_name



--
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] [Commented] (SOLR-8002) Field aliases support for SQL queries

2015-09-09 Thread Dennis Gove (JIRA)

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

Dennis Gove commented on SOLR-8002:
---

I was thinking more in the initial parsing of the SQL statement. At that point 
perhaps create a StreamExpression object. If I'm reading the code correctly it 
appears to go directly from a SQL statement to a Stream object.

> Field aliases support for SQL queries
> -
>
> Key: SOLR-8002
> URL: https://issues.apache.org/jira/browse/SOLR-8002
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Affects Versions: Trunk
>Reporter: Susheel Kumar
>
> Currently field aliases are not supported for SQL queries against SQL 
> Handler. E.g. below SQL query
>  select id,name as product_name from techproducts limit 20
> currently fails as data returned contains still "name" as the field/column 
> key than product_name



--
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] [Commented] (SOLR-8002) Field aliases support for SQL queries

2015-09-09 Thread Susheel Kumar (JIRA)

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

Susheel Kumar commented on SOLR-8002:
-

Thanks, Dennis for the explanation & I agree with the approach that either SQL 
statement or String Expression would be converted to Stream Expression object.

> Field aliases support for SQL queries
> -
>
> Key: SOLR-8002
> URL: https://issues.apache.org/jira/browse/SOLR-8002
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Affects Versions: Trunk
>Reporter: Susheel Kumar
>
> Currently field aliases are not supported for SQL queries against SQL 
> Handler. E.g. below SQL query
>  select id,name as product_name from techproducts limit 20
> currently fails as data returned contains still "name" as the field/column 
> key than product_name



--
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] [Commented] (SOLR-8002) Field aliases support for SQL queries

2015-09-09 Thread Susheel Kumar (JIRA)

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

Susheel Kumar commented on SOLR-8002:
-

Agree, Joel that this is tricky to start.  I'll anyway continue with more tests 
and will look into SOLR-7986 as well.  

> Field aliases support for SQL queries
> -
>
> Key: SOLR-8002
> URL: https://issues.apache.org/jira/browse/SOLR-8002
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Affects Versions: Trunk
>Reporter: Susheel Kumar
>
> Currently field aliases are not supported for SQL queries against SQL 
> Handler. E.g. below SQL query
>  select id,name as product_name from techproducts limit 20
> currently fails as data returned contains still "name" as the field/column 
> key than product_name



--
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] [Commented] (SOLR-8002) Field aliases support for SQL queries

2015-09-08 Thread Susheel Kumar (JIRA)

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

Susheel Kumar commented on SOLR-8002:
-

Hi Joel, Davis,

Just to clarify that utilizing the SelectStream in SQL api (SQLHandler.java) 
would require transforming the SQL expression into SOLR streaming expressions 
for SelectStream to work. So for e.g. SQL expression

select id, field_i, str_s from collection1 where text='' order by field_i 
desc  

would be transformed to

search(collection1, q="text:", fl="id,field_i,str_s", sort="field_i desc")

Please let me know your thoughts on this.

Thanks,
Susheel

  




> Field aliases support for SQL queries
> -
>
> Key: SOLR-8002
> URL: https://issues.apache.org/jira/browse/SOLR-8002
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Affects Versions: Trunk
>Reporter: Susheel Kumar
>
> Currently field aliases are not supported for SQL queries against SQL 
> Handler. E.g. below SQL query
>  select id,name as product_name from techproducts limit 20
> currently fails as data returned contains still "name" as the field/column 
> key than product_name



--
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] [Commented] (SOLR-8002) Field aliases support for SQL queries

2015-09-02 Thread Susheel Kumar (JIRA)

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

Susheel Kumar commented on SOLR-8002:
-

Sure, Joel.  Let me start looking into the patch SOLR-7669. 

> Field aliases support for SQL queries
> -
>
> Key: SOLR-8002
> URL: https://issues.apache.org/jira/browse/SOLR-8002
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Affects Versions: Trunk
>Reporter: Susheel Kumar
>
> Currently field aliases are not supported for SQL queries against SQL 
> Handler. E.g. below SQL query
>  select id,name as product_name from techproducts limit 20
> currently fails as data returned contains still "name" as the field/column 
> key than product_name



--
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] [Commented] (SOLR-8002) Field aliases support for SQL queries

2015-09-02 Thread Dennis Gove (JIRA)

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

Dennis Gove commented on SOLR-8002:
---

SOLR-7669 adds a SelectStream to the streaming and expression apis. It includes 
support for both aliases and operations and might be a good basis for adding 
these features to the SQL api.

> Field aliases support for SQL queries
> -
>
> Key: SOLR-8002
> URL: https://issues.apache.org/jira/browse/SOLR-8002
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Affects Versions: Trunk
>Reporter: Susheel Kumar
>
> Currently field aliases are not supported for SQL queries against SQL 
> Handler. E.g. below SQL query
>  select id,name as product_name from techproducts limit 20
> currently fails as data returned contains still "name" as the field/column 
> key than product_name



--
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] [Commented] (SOLR-8002) Field aliases support for SQL queries

2015-09-02 Thread Joel Bernstein (JIRA)

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

Joel Bernstein commented on SOLR-8002:
--

This makes sense. I haven't had a chance to review SOLR-7669 yet. 

[~susheel2...@gmail.com], if you're working on a patch you might want to see if 
you can work with the SelectStream. You'll need to apply the patch from 
SOLR-7669 as it's not yet in trunk.

> Field aliases support for SQL queries
> -
>
> Key: SOLR-8002
> URL: https://issues.apache.org/jira/browse/SOLR-8002
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Affects Versions: Trunk
>Reporter: Susheel Kumar
>
> Currently field aliases are not supported for SQL queries against SQL 
> Handler. E.g. below SQL query
>  select id,name as product_name from techproducts limit 20
> currently fails as data returned contains still "name" as the field/column 
> key than product_name



--
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] [Commented] (SOLR-8002) Field aliases support for SQL queries

2015-09-01 Thread Joel Bernstein (JIRA)

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

Joel Bernstein commented on SOLR-8002:
--

This actually a new feature request. The SQL interface doesn't yet support 
field aliases.

> Field aliases support for SQL queries
> -
>
> Key: SOLR-8002
> URL: https://issues.apache.org/jira/browse/SOLR-8002
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Affects Versions: Trunk
>Reporter: Susheel Kumar
>
> Currently field aliases are not supported for SQL queries against SQL 
> Handler. E.g. below SQL query
>  select id,name as product_name from techproducts limit 20
> currently fails as data returned contains still "name" as the field/column 
> key than product_name



--
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] [Commented] (SOLR-8002) Field aliases support for SQL queries

2015-09-01 Thread Erik Hatcher (JIRA)

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

Erik Hatcher commented on SOLR-8002:


[~susheel2...@gmail.com] - please provide an example configuration that 
demonstrates this issue.  I've used "as" clauses to successfully map field 
names so maybe this is a configuration issue rather than a bug?

> Field aliases support for SQL queries
> -
>
> Key: SOLR-8002
> URL: https://issues.apache.org/jira/browse/SOLR-8002
> Project: Solr
>  Issue Type: New Feature
>  Components: search
>Affects Versions: Trunk
>Reporter: Susheel Kumar
>
> Currently field aliases are not supported for SQL queries against SQL 
> Handler. E.g. below SQL query
>  select id,name as product_name from techproducts limit 20
> currently fails as data returned contains still "name" as the field/column 
> key than product_name



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