# Converter field to JSON in VDS

**URL:** <https://community.dremio.com/t/converter-field-to-json-in-vds/7808>\
**Category:** Uncategorized\
**Created:** [July 30, 2021, 7:40pm UTC](https://community.dremio.com/t/converter-field-to-json-in-vds/7808 "2021-07-30T19:40:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucasft](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@lucasft](https://community.dremio.com/u/lucasft)\
**Post date:** [July 30, 2021, 7:40pm UTC](https://community.dremio.com/t/converter-field-to-json-in-vds/7808/1 "2021-07-30T19:40:55Z")

</div>

Would it be possible to convert a field to JSON from a VDS? Because I’m able to convert a field to JSON, only when I try to convert directly from PDS.

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [August 2, 2021, 3:27am UTC](https://community.dremio.com/t/converter-field-to-json-in-vds/7808/2 "2021-08-02T03:27:50Z")

</div>

@lucasft Yes it is possible, as long as the column has a JSON struct you should be able to do `CONVERT_FROMJSON(<column_name>)`

Example below

 ![Screen Shot 2021-08-01 at 8.26.49 PM](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/e/e9a0d20fdb5c5e8e05bdddb5762446ea9e1c4085.png)

---

<div class="post-metadata">

**Author:** ![lucasft](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@lucasft](https://community.dremio.com/u/lucasft)\
**Post date:** [August 6, 2021, 9:32pm UTC](https://community.dremio.com/t/converter-field-to-json-in-vds/7808/3 "2021-08-06T21:32:22Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/d/deb120e4abc9899895617ee170ebd096efea422b.png)  
Problem ocorrer when I try transform JSON from other VDS. Just work when this field is direct get from PDS.

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [August 7, 2021, 2:19am UTC](https://community.dremio.com/t/converter-field-to-json-in-vds/7808/4 "2021-08-07T02:19:30Z")

</div>

@lucasft What data type is cardsPartnersCreatedAt?

---

<div class="post-metadata">

**Author:** ![lucasft](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@lucasft](https://community.dremio.com/u/lucasft)\
**Post date:** [August 9, 2021, 2:55pm UTC](https://community.dremio.com/t/converter-field-to-json-in-vds/7808/5 "2021-08-09T14:55:00Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/e/e9b878135ae483c6f13df543e16052126bae2f45.png)  
Marked like string, but is a array that I need transform. Just worked transformation if I get directly from PDS.

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [August 9, 2021, 6:27pm UTC](https://community.dremio.com/t/converter-field-to-json-in-vds/7808/6 "2021-08-09T18:27:35Z")

</div>

@lucasft That does not seem like a valid JSON struct, do you want to split the 2 values into 2 different columns?

---

<div class="post-metadata">

**Author:** ![lucasft](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@lucasft](https://community.dremio.com/u/lucasft)\
**Post date:** [August 9, 2021, 6:38pm UTC](https://community.dremio.com/t/converter-field-to-json-in-vds/7808/7 "2021-08-09T18:38:30Z")

</div>

I need converter this array to split after

 ![image](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/2/2e99fedf4a755a175e3ae97bee7e3625520e9807.png)  
When I transform directly from PDS, worked perfectly. See this example.  
But, if I try transform this same column indirectly througth some VDS, don’t work.

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [August 10, 2021, 8:12am UTC](https://community.dremio.com/t/converter-field-to-json-in-vds/7808/8 "2021-08-10T08:12:34Z")

</div>

@lucasft What is the VDS definition?

---

<div class="post-metadata">

**Author:** ![lucasft](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@lucasft](https://community.dremio.com/u/lucasft)\
**Post date:** [August 10, 2021, 11:01am UTC](https://community.dremio.com/t/converter-field-to-json-in-vds/7808/9 "2021-08-10T11:01:59Z")

</div>

I get from this vds

 ![image](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/1/1e60ebb7ff5f074d82c280c60d5b7423ebe4d503.png)  
Apparently tha function `ROW_NUMBER()` is responsible to block this interfaces column transformation to array, throught CONVERT\_FROMJSON, in other VDS that use this VDS like base.  
My problem is that I need remove repetitions before treat datas, because a have a lot datas.

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [August 16, 2021, 6:43am UTC](https://community.dremio.com/t/converter-field-to-json-in-vds/7808/10 "2021-08-16T06:43:01Z")

</div>

@lucasft I see you are not doing a convert\_from the VDS, are you saying that you tried and it did not work?
