Expand my Community achievements bar.

SOLVED

Writing data into string datatype of array[]

Avatar

Employee

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. 

1 Accepted Solution

Avatar

Correct answer by
Employee

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.

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @brekrut 

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

 

Cheers

Cheers from Switzerland!

Avatar

Employee

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[].

 

 

Avatar

Correct answer by
Employee

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.