dzeyelid / node-red-contrib-azure-data-lake-storage

A Node-RED node library to connect to your Azure Data Lake Storage Gen2
MIT License
0 stars 0 forks source link

RestError #3

Open cverster opened 3 years ago

cverster commented 3 years ago

Hi there!

I'm trying to write a basic CSV to our Azure Data Lake using NodeRed. I do a SQL read, then transform the data into a CSV, and use a function to covnert it into the correct format.

So my flow runs:

Inject -> SQL Read (works fine) -> CSV conversion (works) -> Function -> Azure File Append

Here is the code in my function:

data = msg.payload;

var today = new Date(); var dd = String(today.getDate()).padStart(2, '0'); var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0! var yyyy = today.getFullYear();

today = dd + '' + mm + '' + yyyy;

file = today;

msg.payload = {"filePath": file+"_InventoryMovements"}; msg.payload.content = data;

return msg; I am, however, getting the following data and I'm not sure what it means:

RestError: The uploaded data is not contiguous or the position query parameter value is not equal to the length of the file after appending the uploaded data.

Can someone point me in the right direction?

The CSV output looks ok to me...

StockCode,[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],Bin,[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],[Header],SS_ConsPO 100001000,[Value],[Value],"""2018-02-01T00:00:00.000Z""",[Value],I,[Value],P,000000000058050,4870,5,6.87,R,000000000087640, ,6.87, ,DP STOCK,[Value],[Value]8,0, ,0,0, , , ,0, , , , , , , , ,0, , , , ,5�<,190331 Prior 100001000,[Value],[Value],"""2018-02-06T00:00:00.000Z""",[Value],I,200,1374,J,[Value],I,[Value], ,6.87, ,[Value][Value], ,[Value],[Value], ,0,0, , , ,0, , , , , , , , ,0, , , , ,5��,190331 Prior 100001000,[Value],[Value],"""2019-10-04T00:00:00.000Z""",11013999,I,200,[Value],[Value],[Value],36952,2,6.8...

dzeyelid commented 3 years ago

@cverster Thanks for your reporting!

The error message is raised by the Azure REST API that is used in this node node-red-contrib-azure-data-lake-storage. For more information, see https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/update#response.

I guess it's better to test with more simple data or write the data to Azure Data Lake without Node-RED to test it.