Ask Your Question
1

How to split data by using Stream Selector where origin is JDBC multitable consumer.

asked 2018-09-05 23:09:17 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I have a pipeline which uses the JDBC Multitable origin. Currently this origin pulls 2 HANA tables. I need to send the data from each HANA table to 5 different Trashes. Can I use the stream selector to build 2 different conditions to write out to 2 Trashes destinations? If so, what would the syntax look like for the stream selector conditions?

i kept ${record:value('/jdbc.tables')=='/LFA1'} & ${record:value('/jdbc.tables')=='/LFB1'} as two conditions in the stream selector but it doesn't work

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-09-06 10:30:49 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

You can write an expression like following in stream selector split the incoming stream into separate groups

${record:attribute('jdbc.tables') == 'table_A'}

${record:attribute('jdbc.tables') == 'table_B'}

jdbc.tables property is contained in the record header and you can see additional metadata information that is contained in the record header if you preview the pipeline and check the "show record header information" option.

For more information, please refer to section titled JDBC Header Attributes at the following link

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

Hope it helps.

edit flag offensive delete link more

Comments

I tried with below expression also & noticed that only 'table_B' information is being passed. Also in stream collector condition 2 is being executed where as condition 1 & condition 3 are not processed.

Asish gravatar imageAsish ( 2018-09-06 23:54:23 -0500 )edit
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2018-09-05 23:09:17 -0500

Seen: 116 times

Last updated: Sep 06