3

I have a datafactory that reads from a table and stores the output as a CSV to Blob Storage.

I have noticed that instead of leaving a NULL field blank it inserts the NULL character \N.. Now the external system that is ingesting this can't handle \N.

Is there anyway in my dataset where I can say leave nulls blank.

Below is my dataset properties:

  "typeProperties": {
        "fileName": "MasterFile-{fileDateNameVariable}.csv",
        "folderPath": "master-file-landing",
        "format": {
            "type": "TextFormat",
            "columnDelimiter": ",",
            "firstRowAsHeader": true
        },
        "partitionedBy": [
            {
                "name": "fileDateNameVariable",
                "value": {
                    "type": "DateTime",
                    "date": "SliceStart",
                    "format": "yyyyMMdd"
                }
            }
        ]
    },

Thanks in advance.

Ed Baker
  • 643
  • 1
  • 6
  • 16
  • checking the documentation I see an example: "NullValue": "NaN", I wonder if "NullValue": "", will work – Ed Baker Apr 03 '18 at 03:59

1 Answers1

3

You could set the Null value to "" when you set your dataset. Please refer to my test.

Table data:

enter image description here

Output Dataset:

enter image description here

enter image description here

Generate csv file:

enter image description here

Hope it helps you.

Jay Gong
  • 23,163
  • 2
  • 27
  • 32
  • A good option, but I really wanted to have a truly blank cell `2,Peter,,`, not an empty string `2, Peter,"",""`. The best way I found to do this was to change the JSON for the dataset to include `"nullValue": ""` so that it didn't use the default setting. It can also be accomplished through the UI by setting it to dynamic content `concat('')` which is two single quote characters`'`, not a double quote `"`. I got to that solution based on this question: https://stackoverflow.com/questions/52005554/datafactory-v2-replace-n-null-value-with-blank – DavidP Sep 24 '18 at 20:59