You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Timothy Potter (Jira)" <ji...@apache.org> on 2021/06/21 21:12:00 UTC

[jira] [Resolved] (SOLR-15456) Solr SQL metrics for field with custom field type defaults to String instead of using the correct numeric type

     [ https://issues.apache.org/jira/browse/SOLR-15456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Potter resolved SOLR-15456.
-----------------------------------
    Fix Version/s: main (9.0)
       Resolution: Fixed

> Solr SQL metrics for field with custom field type defaults to String instead of using the correct numeric type
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-15456
>                 URL: https://issues.apache.org/jira/browse/SOLR-15456
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Parallel SQL
>            Reporter: Timothy Potter
>            Assignee: Timothy Potter
>            Priority: Minor
>              Labels: RobustSQL
>             Fix For: main (9.0)
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> I have a simple "stats" query (from SolrTable) that requests the min / max of an integer field, but that field is declared in the schema using a custom field type, such as:
> {code}
>   <fieldType name="integer" class="solr.TrieIntField" .../>
>   <field name="myIntField" type="integer"  .../>
> {code}
> The switch at https://github.com/apache/solr/blob/main/solr/core/src/java/org/apache/solr/handler/sql/SolrSchema.java#L144 causes the "type" for this field to be {{String}} which results in some weird output for this query:
> {code}
> SELECT min(myIntField), max(myIntField) from table
> {code}
> Results:
> {code}
> {
>   "result-set":{
>     "docs":[{
>         "EXPR$0":"2.0210507E7",
>         "EXPR$1":"2.0210605E7"}
>       ,{
>         "EOF":true,
>         "RESPONSE_TIME":8846}]}}
> {code}
> Since we're querying {{/luke}} already to get schema info, we might as well use the field type info vs. defaulting to String



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org