Pierre Beck created SOLR-12970:
----------------------------------
Summary: Inconsistency between VariableResolver returning "" and
FieldStreamDataSource testing for null
Key: SOLR-12970
URL: https://issues.apache.org/jira/browse/SOLR-12970
Project: Solr
Issue Type: Bug
Security Level: Public (Default Security Level. Issues are Public)
Components: contrib - DataImportHandler
Affects Versions: 7.5
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.
Reporter: Pierre Beck
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);
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]