Extra \ character while generating json file
![Ankur5289](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar8.png)
I am facing an issue where i get an extra "\" character while generating json data format from an existing MSSQL data set. The data that i see in json file is like this:
"poLines":"[{\"itemNumber\":52302486,\"quantity\":7,\"dueDate\":20200621,\"poLineNumber\":0}]",
the prepare recipe with "Nest" function makes this an extra string character. Anyone encountered this issue and please let us know how did you solve this?
Best Answers
-
Ankur5289 Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS Core Concepts, Registered Posts: 27 Partner
@Alex
Thanks for the response. We are using a custom recipe to create .json files format.Issue is it is not allowing to change data type to “Array” from a string. This is shown below :
You see all are highlighted as pink and if we change to array it gets converted back to string. How can we store this as an array here ? if we solve this it would be great
-
Ankur5289 Partner, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS Core Concepts, Registered Posts: 27 Partner
We figured out the solution . Basically we were using settings to maintain strict schema equality and hence it was converting an array to string in the cosmos DB.
We are now using the setting free output schema and now it worked
Answers
-
Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,211 Dataiker
Hi @Ankur5289
,Can you provide some details on how you are exporting the the json file? We don't support exporting to .json directly from Export recipe. Perhaps you have a code recipe that does this?
If I have a dataset add a nest in prepare recipe this is my output CSV files using Export to Folder recipe as you can see the json is not escaped.
Thanks,
-
Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,211 Dataiker
Hi,
I am only able to reproduce even when using json. To be able to make that json an array you can use a forumla recipe contact "[" the existing and "]". Then DSS will allow selecting the Array time. See below. Let me know if this helps.