Ask Your Question
1

Need to find the length of the list

asked 2018-07-20 13:06:55 -0600

KRT gravatar image

updated 2018-07-20 14:56:40 -0600

metadaddy gravatar image

In Expression evalutor, I have used ${length('/Care')} to find out the length of the list but getting below error-

EXPR_00 - Invalid expression '${length('/Care')}': com.streamsets.pipeline.api.el.ELEvalException: CTRCMN_0100 - Error evaluating expression ${length('/Care')}: javax.servlet.jsp.el.ELException: Attempt to convert String "/Care" to type "java.util.List", but there is no PropertyEditor for that type

Input list looks like -

> Care : {LIST [2]}
  [0] : {MAP}
  [1] : {MAP}

I have check the datatype of Care field, it is showing as "LIST"

Documentation https://streamsets.com/documentation/...

How to find the length of the list?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-07-20 14:57:44 -0600

metadaddy gravatar image

You're almost there - you just need to use record:value() to get the actual list value, rather than the field name, like this:

${length(record:value('/Care'))}
edit flag offensive delete link more

Comments

I tried that as well but getting below error EXPR_00 - Invalid expression '${length(record:value('/Care'))}': com.streamsets.pipeline.api.el.ELEvalException: CTRCMN_0100 - Error evaluating expression ${length(record:value('/Care'))}: java.lang.NullPointerException

KRT gravatar imageKRT ( 2018-07-20 15:21:47 -0600 )edit

I tried length() function in stream selector component, it complains javax.servlet.jsp.el.ELException: No function is mapped to the name "length"

casel.chen gravatar imagecasel.chen ( 2018-09-11 01:38:11 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-07-20 13:06:55 -0600

Seen: 90 times

Last updated: Jul 20