Opened 10 years ago
Closed 10 years ago
#1862 closed defect (fixed)
If() formula can't return null value
Reported by: | Nicklas Nordborg | Owned by: | everyone |
---|---|---|---|
Priority: | major | Milestone: | BASE 3.3.2 |
Component: | core | Version: | |
Keywords: | Cc: |
Description
Create an 'Intensity expression' formula with for example:
if(raw('status') == 'HIDATA', null, raw('fpkm'))
Eg. it should return null if status is HIDATA, otherwise the 'fpkm' value.
Error message when creating a root bioassay set:
13:35:01,748 ERROR InternalJobQueue:585 - Exception while executing job: Job[id=633834; name=Create root bioassay set in experiment 'New experiment' using formula 'FPKM (null hidata)'] net.sf.basedb.core.BaseException: Invalid use of null. The 'value' value cannot be set to null. at net.sf.basedb.core.InternalJobQueue$JobRunner.run(InternalJobQueue.java:579) at java.lang.Thread.run(Unknown Source) Caused by: net.sf.basedb.core.InvalidUseOfNullException: Invalid use of null. The 'value' value cannot be set to null. at net.sf.basedb.core.query.WhenStatement.<init>(WhenStatement.java:52) at net.sf.basedb.util.jep.convert.IfConverter.toExpression(IfConverter.java:78) at net.sf.basedb.util.jep.convert.IfConverter.toExpression(IfConverter.java:40) at net.sf.basedb.util.jep.convert.ASTFunNodeConverter.toExpression(ASTFunNodeConverter.java:83) at net.sf.basedb.util.jep.convert.ASTFunNodeConverter.toExpression(ASTFunNodeConverter.java:43) at net.sf.basedb.util.jep.Jep.nodeToExpression(Jep.java:295) at net.sf.basedb.util.jep.Jep.jepToExpression(Jep.java:223) at net.sf.basedb.util.jep.Jep.formulaToExpression(Jep.java:234) at net.sf.basedb.util.IntensityCalculatorUtil.createJepExpressions(IntensityCalculatorUtil.java:504) at net.sf.basedb.plugins.IntensityCalculatorPlugin.run(IntensityCalculatorPlugin.java:240) at net.sf.basedb.core.PluginExecutionRequest.invoke(PluginExecutionRequest.java:116) at net.sf.basedb.core.InternalJobQueue$JobRunner.run(InternalJobQueue.java:571) ... 1 more
Note:
See TracTickets
for help on using tickets.
(In [6557]) Fixes #1862: If() formula can't return null value