Writing data into string datatype of array[] | Community
Skip to main content
brekrut
Adobe Employee
Adobe Employee
May 30, 2024
Solved

Writing data into string datatype of array[]

  • May 30, 2024
  • 1 reply
  • 1037 views

Hello

 

when the following field is present upon a schema, I am facing an issue when attempting to write data into the field.

"sampleField": {
  "title": "Sample Array Field",
  "description": "An example array field using a primitive type.",
  "type": "array",
  "items": {
    "type": "string"
  }
}

 The field is defined as field[], which is just an array based field.

 

I have attempted to use collect_set to insert data into the field, but getting an error message of object is not compatible of target type string. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by brekrut

I was able to figure out the issue I was facing. The data ingested into the datalake had empty string values which was not being accounted for.

 

Using arrag_agg(column_name) filter (where column name is not null) allowed for the insert of data into the new dataSet.

1 reply

bjoern__koth
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
May 30, 2024

Hi @brekrut 

can you give more context when/how/where you are trying to set the field?

 

Cheers

Cheers from Switzerland!
brekrut
Adobe Employee
brekrutAdobe EmployeeAuthor
Adobe Employee
May 30, 2024

Hello @bjoern__koth 

 

I have a schema which has a field defined a foo[] of array.  Data has been ingested into dataSetA but I am attempting to use query service to write data into a new dataSet which has been built against the same schema containing the field defined as foo[].

 

 

brekrut
Adobe Employee
brekrutAdobe EmployeeAuthorAccepted solution
Adobe Employee
May 31, 2024

I was able to figure out the issue I was facing. The data ingested into the datalake had empty string values which was not being accounted for.

 

Using arrag_agg(column_name) filter (where column name is not null) allowed for the insert of data into the new dataSet.