Spark Table using CSV - Line Separator

Ryan Abbey 1,171 Reputation points
2023-02-08T04:45:54.5633333+00:00

I'm trying to create a Spark table using a CSV as source. The CSV file has row delimiter of \r\n, however, the last field in the file is returning a \r when an empty string.

Result

Source value

According to documentation, \r\n should be handled by default

  • lineSep (default covers all \r, \r\n, and \n): defines the line separator that should be used for parsing. Maximum length is 1 character.

This is clearly not the case but I am getting no change in the result should I specify the lineSep within the options (regardless of whether I try \r, \r\n or \n) which suggests it is something we can't override (or lineSep isn't the correct syntax), any other suggestions?

Thanks

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,355 questions
Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
1,911 questions
{count} votes