question

lakshmireddykondapureddy-4369 avatar image
0 Votes"
lakshmireddykondapureddy-4369 asked SumanthMarigowda-MSFT answered

Azure Data Lake Gen2 storing JSON file results in encoding content as NUL (Ascii 0) characters

We are creating json file in Azure Data Lake Gen2 from java application. File write success but content is encoded with one liner of NUL (Ascii 0) characters. This is happening intermittently.

anything to do with storage account?

77727-capture.png


azure-data-lake-storage
capture.png (14.0 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@lakshmireddykondapureddy-4369 Firstly, Apologies for the delay in responding here!
For better understating the issue: Can you share your code(excluding the PI information)?
Can you provide more information on you query?
Are you saying the file contains only nulls? Or that there is a null at the end?

0 Votes 0 ·

@lakshmireddykondapureddy-4369
Just checking in to see if you have had a chance to see the previous response. Could you share the above required information to understand/investigate this issue further?


0 Votes 0 ·

1 Answer

SumanthMarigowda-MSFT avatar image
0 Votes"
SumanthMarigowda-MSFT answered

@lakshmireddykondapureddy-4369
Just checking in to see if you have had a chance to see the previous response. Could you share the above required information to understand/investigate this issue further?
We had a similar issue with creating .json files using Powershell and the Out-File command.
It would produce the file just fine (so we thought), but when we tried to parse it from a bash command in a YAML pipeline it threw an error saying it’s not valid json.
We ended up finding out that the Out-File command added some non-printable characters to the start of the file. Basically we needed a specific encoding on the file.

We had to include an encoding parameter with our out-file command to encode it the way we needed it (UTF8).
Perhaps you would need to explicitly state the encoding needed when creating the file or writing to the file?
This might not explain why it’s intermittent unless for some reason the default encoding is different for the different instances running this code.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.