Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Won't Fix
-
3.1.1, 3.5, 3.6, 3.6.1, 4.0-ALPHA
-
None
Description
When using an Evaluator outside an entity element the Context argument is null.
foo.LowerCaseFunctionEvaluator.java
public class LowerCaseFunctionEvaluator extends Evaluator { public String evaluate(String expression, Context context) { List l = EvaluatorBag.parseParams(expression, context.getVariableResolver()); if (l.size() != 1) { throw new RuntimeException("'toLowerCase' must have only one parameter "); } return l.get(0).toString().toLowerCase(); } }
data-config.xml
<dataSource name="..." type="..." driver="..." url="..." user="${dataimporter.functions.toLowerCase('THIS_WILL_NOT_WORK')}" password="..."/>
data-config.xml
<entity name="..." dataSource="..." query="select * from ${dataimporter.functions.toLowerCase('THIS_WILL_WORK')}"/>
This use case worked in 1.4
Attachments
Issue Links
- is duplicated by
-
SOLR-2899 Custom DIH Functions in Delta-Query have null Context
- Resolved
- is related to
-
SOLR-2186 DataImportHandler multi-threaded option throws exception
- Closed
- is superceded by
-
SOLR-14783 Remove DIH from 9.0
- Closed