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

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17366838#comment-17366838 ] 

ASF subversion and git services commented on SOLR-15456:
--------------------------------------------------------

Commit ae7b276d50ed4376b1f47bedb9d424e4684999f9 in solr's branch refs/heads/main from Timothy Potter
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=ae7b276 ]

SOLR-15456: Get field type info from luke for custom fields instead of defaulting to String for Parallel SQL (#181)



> 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
>          Time Spent: 50m
>  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