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:


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$
	at 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>(
	at net.sf.basedb.util.jep.convert.IfConverter.toExpression(
	at net.sf.basedb.util.jep.convert.IfConverter.toExpression(
	at net.sf.basedb.util.jep.convert.ASTFunNodeConverter.toExpression(
	at net.sf.basedb.util.jep.convert.ASTFunNodeConverter.toExpression(
	at net.sf.basedb.util.jep.Jep.nodeToExpression(
	at net.sf.basedb.util.jep.Jep.jepToExpression(
	at net.sf.basedb.util.jep.Jep.formulaToExpression(
	at net.sf.basedb.util.IntensityCalculatorUtil.createJepExpressions(
	at net.sf.basedb.core.PluginExecutionRequest.invoke(
	at net.sf.basedb.core.InternalJobQueue$
	... 1 more

Change History (1)

comment:1 by Nicklas Nordborg, 10 years ago

Resolution: fixed
Status: newclosed

(In [6557]) Fixes #1862: If() formula can't return null value

Note: See TracTickets for help on using tickets.