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

Kevin Risden commented on SOLR-8002:
------------------------------------

{quote}
But because values are keyed by columnName in the tuple I think it could just 
be reversed where when asking for a value by columnIndex the index could be 
translated to the columnName and that name used to lookup the actual value.
{quote}

I agree that looking up by index could be translated into column name, but that 
requires that the mapping of name to index or vice versa to be available at the 
driver. Currently, there is no metadata that keeps track of positional index to 
column name that gets passed back from the SQLHandler. I had a working solution 
that added some metadata to the stream (and had to change the JSONTupleStream 
parsing) and that seemed awkward/wrong. Maybe there is a better way to pass the 
metadata back from the SQL handler?

The least intrusive to me seems to me to be that the Tuple object be able to 
keep its fields in order and not only by name. I don't know how to enforce this 
though other than maybe using the LinkedHashMap and some tests to ensure that a 
new stream doesn't cause issues.

> Add column alias support to the Parallel SQL Interface 
> -------------------------------------------------------
>
>                 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
>            Assignee: Joel Bernstein
>             Fix For: 6.0
>
>         Attachments: SOLR-8002.patch, SOLR-8002.patch
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to