Details

    • Type: Task
    • Status: Done
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: Search Services 2.0
    • Labels:
      None

      Description

      Cast as <datatype> as to be taken out of the scope (Please note a change in Documentation Oliver Stanley, an example of Cast as Double needs to be removed from the Docs)
      As:

      select CAST(sum(`cm:content.size`)/1000 AS Double) from alfresco - works but
      select CAST(sum(`cm:content.size`)/1000 AS Long) from alfresco - does not and
      select CAST(sum(`cm:content.size`)/1000 AS Int) from alfresco - does not
      java.sql.SQLException: java.sql.SQLException: java.io.IOException: 11130205 Unable to execute the query, error caused by: class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap')
      	at org.apache.solr.client.solrj.io.sql.StatementImpl.executeQueryImpl(StatementImpl.java:94)
      	at org.apache.solr.client.solrj.io.sql.StatementImpl.getResultSet(StatementImpl.java:301)
      	at org.apache.commons.dbcp2.DelegatingStatement.getResultSet(DelegatingStatement.java:219)
      	at org.apache.commons.dbcp2.DelegatingStatement.getResultSet(DelegatingStatement.java:219)
      	at org.apache.zeppelin.jdbc.JDBCInterpreter.executeSql(JDBCInterpreter.java:739)
      

      Acceptance Criteria

      • CAST operation between number datatypes don't raise any exception
      • BIGINT, INT,INTEGER casts work as expected. Note that since the test verification uses Java API, when the JSON -> Java marshalling happens, the information about the integer datatype (i.e. java.lang.Integer/java.lang.Long) is lost and everything is converted to java.lang.Long.
      • DECIMAL casts  work as expected. Note that since the test verification uses Java API, when the JSON -> Java marshalling happens, the information about the decimal datatype (i.e. java.lang.Float/java.lang.Double) is lost and everything is converted to java.lang.Double. 

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  aborroy Angel Borroy
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Structure Helper Panel