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

Inconsistency between VariableResolver returning "" and FieldStreamDataSource testing for null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 7.5
    • None
    • None
    • 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

              Unassigned Unassigned
              pierrepoulpe Pierre Beck
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: