Yes, it worked on the stream handler:

sql(
    stmt="SELECT my_field from my_collection ORDER BY my_field",
  )

Thank you!


Em qui., 7 de set. de 2023 às 18:18, ufuk yılmaz
<uyil...@vivaldi.net.invalid> escreveu:
>
> Can you try adding an “order by someFieldWithDocvalues” clause to the second 
> sql? My guess is it needs to sort by some field but when you don’t specify 
> anything to sort, it by default uses the _version_ field which doesn’t have 
> docvalues.
>
> —
>
> > On 7 Sep 2023, at 22:45, Kojo <rbsnk...@gmail.com> wrote:
> >
> > Hi,
> > I am making tests on the stream handler, but I am not sure whether it
> > was supposed to work or not.
> >
> > When I test the following query:
> >
> > 192.168.1.100:8983/solr/my_collection/stream?expr=sql(stmt=SELECT
> > NON_DOC_VALUES_FIELD FROM my_collection)
> >
> > I obtain the following exception:
> >
> > {
> >  "result-set": {
> >    "docs": [
> >      {
> >        "EXCEPTION": "-->
> > http://172.18.0.4:8983/solr/my_collection_shard2_replica_n1/:Failed to
> > execute sqlQuery 'SELECT NON_DOC_VALUES_FIELD FROM my_collection'
> > against JDBC connection 'jdbc:calcitesolr:'.\nCaused by: Error while
> > executing SQL \"SELECT NON_DOC_VALUES_FIELD FROM my_collection\":
> > java.io.IOException: java.util.concurrent.ExecutionException:
> > java.io.IOException: -->
> > http://172.18.0.4:8983/solr:NON_DOC_VALUES_FIELD{type=text,properties=indexed,tokenized,stored,multiValued,sortMissingLast,uninvertible}
> > must have DocValues to use this feature.",
> >        "EOF": true,
> >        "RESPONSE_TIME": 36
> >      }
> >    ]
> >  }
> > }
> >
> > When I test the following query:
> >
> > 192.168.1.100:8983/solr/my_collection/stream?expr=sql(stmt=SELECT
> > DOC_VALUES_FIELD FROM my_collection)
> >
> > I obtain the following exception, which seems weird, because it is not
> > related to the DOC_VALUES_FIELD, but the _version_ field.
> >
> > {
> >  "result-set": {
> >    "docs": [
> >      {
> >        "EXCEPTION": "-->
> > http://172.18.0.3:8983/solr/my_collection_shard1_replica_n4/:Failed to
> > execute sqlQuery 'SELECT DOC_VALUES_FIELD FROM my_collection' against
> > JDBC connection 'jdbc:calcitesolr:'.\nCaused by: Error while executing
> > SQL \"SELECT DOC_VALUES_FIELD FROM my_collection\":
> > java.io.IOException: java.util.concurrent.ExecutionException:
> > java.io.IOException: -->
> > http://172.18.0.4:8983/solr:_version_{type=long,properties=indexed,stored,omitNorms,omitTermFreqAndPositions,uninvertible}
> > must have DocValues to use this feature.",
> >        "EOF": true,
> >        "RESPONSE_TIME": 59
> >      }
> >    ]
> >  }
> > }
> >
> >
> >
> > Does the second one should work? Is there a way to use raw SQL in a SE?
> >
> > I know about the sql handler but I would like to obtain more complex
> > results using SE.
> >
> > Thank you,
> > Koji
>

Reply via email to