Expand my Community achievements bar.

Help shape the future of AI assistance by participating in this quick card sorting activity. Your input will help create a more effective system that better serves your needs and those of your colleagues.
SOLVED

Error in filed value while using data prep function in AEP

Avatar

Community Advisor

Hi,

I am trying to ingest a delimiter(space) separated string from a CSV file to an array field in AEP by using "split" data prep function. Below are input string and data prep function I am using.

Using data prep function the data that gets inserted is an error text " [Ljava.lang.String;@59c1a063}"  and not the split values from the string.

Can anyone please suggest what could be possible issue here and how to resolve this. I tried using a statis string in data prep split function but getting the same error in schema filed value.

Input String in CSV: 'c1 c2 c3 c4'

customerIdcategoryNames
1001c1 c2 c3 c4
1002c1 c2
1003c1 c2 c3

split function code -> split(categoryNames, " ")

Split function preview

SnehaParmar_1-1694190377449.png

Filed value with error

SnehaParmar_2-1694190496800.png

https://experienceleague.adobe.com/docs/experience-platform/data-prep/home.html? 

 

Thanks!

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hi @Sneha-Parmar ,

 

In my test setup, the "categoryname" field is set up as an Array of String.

When you're mapping data in the dataflow, it automatically points to the first item (index 0) in the array. So, when you're mapping data to an array field, you don't need to specify indices.

To resolve the problem, please remove the [0] index when mapping, and then try to ingest the data again as I mentioned in my earlier message.

Krish829_0-1694416069803.png

Krishna

 

View solution in original post

6 Replies

Avatar

Level 2

Hi @Sneha-Parmar ,

 

The string "[Ljava.lang.Object;@559ce775" is not a typical human-readable representation of data. Instead, it appears to be a result of calling the toString() method on an array of objects in Java at the AEP backend.
 
Breaking down the components:
 
1). [Ljava.lang.Object;: This part indicates that you have an array ([) of objects (Ljava.lang.Object;).
  In Java, arrays are denoted by square brackets, and Ljava.lang.Object; represents the fully qualified name of the Object class.
 
2). @559ce775: This is the hexadecimal representation of the memory address where the array object is located in memory.
It's a unique identifier for that specific instance of the array.
 
This issue would be fixed by using below mapper function and dataflow mapping logic-
 
Mapper Function- to_array(true,split(categoryNames, " "))
 
Dataflow Mapping Logic- to_array(true,split(categoryNames, " "))  --->  <<tenantId>>.categoryname
attached screenshot of df mapping.
 
Krish829_0-1694278108292.pngKrish829_1-1694278193099.png

 

Regards,

Krishna Gupta

 

Avatar

Community Advisor

Hi @Krish829 ,

 

I tried above mapper function as well but same error as before. Also I see in your data mapping above you have mapped input list category name filed to a String filed which is not the case. My  schema filed is of type  string and marked as an array. Please see below. Please let me know if there is a workaround when the schema filed is a String Array and not simple String. 

SnehaParmar_0-1694412942230.png

Thanks

Avatar

Correct answer by
Level 2

Hi @Sneha-Parmar ,

 

In my test setup, the "categoryname" field is set up as an Array of String.

When you're mapping data in the dataflow, it automatically points to the first item (index 0) in the array. So, when you're mapping data to an array field, you don't need to specify indices.

To resolve the problem, please remove the [0] index when mapping, and then try to ingest the data again as I mentioned in my earlier message.

Krish829_0-1694416069803.png

Krishna

 

Avatar

Community Advisor

Thankyou @Krish829  for all your inputs. The solution worked. The problem was that I was not removing "[0]" while mapping source to destination fields and hence getting error in data value. Thanks again for your help !

Avatar

Community Advisor

Hi @Krish829 ,

Need one more help on arrays, Have you tried share an array filed to any destination while segment activation. How does filed value appear at destination end? Can those be extracted index wise or it appear as string?

Thanks again ! 

Avatar

Level 2

Hi @Sneha-Parmar ,

 

During Segment Activation, you can't directly match an array-type source field with the destination, but you can send individual items from the source array to the destination based on their index. For example:

Source: xdm:<<tenantId>>.categoryname[i]
Where "i" can be 0, 1, 2, and so on.

 

Alternatively, you can activate dataset to share array field. And the format at destination would be

"categoryname" : ["c1","c2","c3"] in a JSON file.

 

Krishna