Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-12970

Inconsistency between VariableResolver returning "" and FieldStreamDataSource testing for null

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 7.5
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      solr 7.5.0, tried on win7 32 and ubuntu x64.

      I get the problem with oracle data source, because I typed field name lower case, I had to type it upper case.

      Description

      If one mistype dataField, we should get an error "No field available for name : "

      Instead you get a mystic  "unsupported type : class java.lang.String"

       

      in FieldStreamDataSource.java
      https://github.com/apache/lucene-solr/blob/master/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/FieldStreamDataSource.java

      l. 63, if (o == null) {
      the code is testing if the freshly returned o is null

      But in VariableResolver.java
      (https://github.com/apache/lucene-solr/blob/master/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/VariableResolver.java)
      public Object resolve(String name) {
      l 118 : return r == null ? "" : r;

      If field cannot be resolved, resolve() returns "" instead of null. But getData() is expecting null if unresolved and throw a more explanary error l. 64 throw new DataImportHandlerException(SEVERE, "No field available for name : " + dataField);

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              pierrepoulpe Pierre Beck

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment