# How to parse an array of structs in streaming pipeline builder

**URL:** <https://community.palantir.com/t/how-to-parse-an-array-of-structs-in-streaming-pipeline-builder/498>\
**Category:** Ask the Community\
**Tags:** pipeline-builder\
**Created:** [June 24, 2024, 1:58pm UTC](https://community.palantir.com/t/how-to-parse-an-array-of-structs-in-streaming-pipeline-builder/498 "2024-06-24T13:58:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![groth](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@groth](https://community.palantir.com/u/groth)\
**Post date:** [June 24, 2024, 1:58pm UTC](https://community.palantir.com/t/how-to-parse-an-array-of-structs-in-streaming-pipeline-builder/498/1 "2024-06-24T13:58:35Z")

</div>

I have an array of structs field and I want to flatten the column into multiple parallel arrays where each has one struct field. Is this possible in builder (streaming)? Which transform(s) would I use?

See example below.

Input Array[Struct] column:  
[  
{  
“pose\_”: {  
“orientation\_”: {  
“w\_”: “1”,  
“x\_”: “0”,  
“y\_”: “0”,  
“z\_”: “0”  
},  
“position\_”: {  
“x\_”: “0”,  
“y\_”: “10”,  
“z\_”: “0”  
}  
}  
},  
{  
“pose\_”: {  
“orientation\_”: {  
“w\_”: “1”,  
“x\_”: “0”,  
“y\_”: “0”,  
“z\_”: “0”  
},  
“position\_”: {  
“x\_”: “10”,  
“y\_”: “20”,  
“z\_”: “0”  
}  
}  
},  
{  
“pose\_”: {  
“orientation\_”: {  
“w\_”: “1”,  
“x\_”: “0”,  
“y\_”: “0”,  
“z\_”: “0”  
},  
“position\_”: {  
“x\_”: “10”,  
“y\_”: “50”,  
“z\_”: “0”  
}  
}  
}  
]

Output Array[double] columns:  
pose\_orientation\_w: [1,1,1]  
pose\_orientation\_x: [0,0,0]  
pose\_orientation\_y: [0,0,0]  
pose\_orientation\_z: [0,0,0]  
pose\_position\_x: [0,10,10]  
pose\_position\_y: [10,20,50]  
pose\_position\_z: [0,0,0]

---

<div class="post-metadata">

**Author:** ![dherls](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/dherls/32/19_2.png) [@dherls](https://community.palantir.com/u/dherls)\
**Post date:** [June 24, 2024, 2:27pm UTC](https://community.palantir.com/t/how-to-parse-an-array-of-structs-in-streaming-pipeline-builder/498/2 "2024-06-24T14:27:45Z")

</div>

Hi @groth you can use a combination of the “Transform array element” and “Get struct field” expressions:

Notional example:

 ![image](https://canada1.discourse-cdn.com/palantir/original/1X/ff879d3a8b6aa3da2f83f1409624f73b3df81805.png)

You will need to repeat this board several times to extract all of the values you want.

---

<div class="post-metadata">

**Author:** ![asohrabi](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@asohrabi](https://community.palantir.com/u/asohrabi)\
**Post date:** [December 19, 2024, 10:36pm UTC](https://community.palantir.com/t/how-to-parse-an-array-of-structs-in-streaming-pipeline-builder/498/3 "2024-12-19T22:36:31Z")

</div>

Hey @dherls! Let’s assume I did not know how many elements would be in the resulting after the first step but they would all have the same schema for the key: value pairs. Is there any way to grab all of those pairs without manually locating them?

---

<div class="post-metadata">

**Author:** ![dherls](https://yyz1.discourse-cdn.com/palantir/user_avatar/community.palantir.com/dherls/32/19_2.png) [@dherls](https://community.palantir.com/u/dherls)\
**Post date:** [December 20, 2024, 2:13pm UTC](https://community.palantir.com/t/how-to-parse-an-array-of-structs-in-streaming-pipeline-builder/498/4 "2024-12-20T14:13:21Z")

</div>

Hi @asohrabi pipeline builder unfortunately does not allow for dynamic column creation, so you would need to know all of the locators in advance
