cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Data Streaming - KAFKA Adapter - Importing JSON array

Pai_N
Explorer
0 Kudos
219

Hello Gurus, 

My Question is regarding JSON Input Kafka Adapter. I want to know the possibility to import JSON array form kafka adapter. Sample JSON want to import from kafka adapter.

my sample array json structure. I want to fetch all items from array billableitems[]. 

Pai_N_0-1726843709421.png

 

 

Pai_N
Explorer
0 Kudos
@RobertWaywell , Can you please help me in solving this issue.
RobertWaywell
Product and Topic Expert
Product and Topic Expert
0 Kudos
What have you tried so far? Can you post the ccl that you are currently using? What errors are you getting when compile or run the project?

Accepted Solutions (0)

Answers (1)

Answers (1)

Pai_N
Explorer
0 Kudos

Hello, @RobertWaywell   For Testing my kafka adapter , I have created Project with 2  kafka input adapters. 1st one to fetch non-array json value from input adapter( Kafka_JSON_struct_input ) , 2nd one array json value from input adapter ( Kafka_JSON_array_input ). Both Input adapters connected to respective output adapters which connects them to respective HANA tables.

My Projects looks like this. 

Pai_N_0-1726841753644.png

 

When I run my project, I don't see any error in both input adapters. Both are in CONTINUOS state. 

My non-array json adapter is working fine. I'm able to fetch value from adapter and capture in input stream. My problem is while fetching json array value.
I'm not able to fetch array values into input stream.

Pai_N_1-1726840759999.png

my sample array json structure. I want to fetch from array billableitems[]. 

Pai_N_2-1726840827446.png

This is how I mapped jsonColsMappingList & jsonRootpath. 

jsonColsMappingList = 'itemid,entitlementid,purchaseauthorizationid,itembillingstate'.  /* List of column names separated by comma */
jsonRootpath = 'value.value.content.businessevent.billingitems[0]'.  /* for testing wanted to fetch 1st line from array */  

ccl file attached. 

I'm not able to figure out why I am not able to fetch  array values.  Is there something I need to add some additional parameter in input parameter ?  can you please suggest. Thanks . 

 

Pai_N
Explorer
0 Kudos
@RobertWaywell can you please have look on this issue and suggest.