<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Spark adding NUL in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12152#M7006</link>
    <description>&lt;P&gt;Thank you so much, this worked for me​&lt;/P&gt;</description>
    <pubDate>Fri, 29 Oct 2021 15:11:40 GMT</pubDate>
    <dc:creator>vasu_sethia</dc:creator>
    <dc:date>2021-10-29T15:11:40Z</dc:date>
    <item>
      <title>Spark adding NUL</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12145#M6999</link>
      <description>&lt;P&gt;Hi I have a DF which contains Json string so the value is like {"key": Value, "anotherKey": anotherValue}, so when I am trying to write the DF containing this string to the CSV, spark is ​adding NUL character af the front of this line and at the end, so the final line is like&lt;/P&gt;&lt;P&gt;NUL{"​key": Value, "anotherKey": anotherValue}NUL&lt;/P&gt;&lt;P&gt;I really don't want this to happen, how can I prevent this?&lt;/P&gt;&lt;P&gt;The code I am using is &lt;/P&gt;&lt;P&gt;df.coalesce(1).write.format("csv").option("header", false).option("quote", "").save(path)​&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 02:39:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12145#M6999</guid>
      <dc:creator>vasu_sethia</dc:creator>
      <dc:date>2021-10-29T02:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Spark adding NUL</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12146#M7000</link>
      <description>&lt;P&gt;Hello, @Vasu Sethia​!  My name is Piper and I'm one of the moderators for Databricks. Welcome and thank you for your question. Let's give it a bit longer to see what the community has to say.  Otherwise, we'll circle back around soon.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 03:01:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12146#M7000</guid>
      <dc:creator>Piper_Wilson</dc:creator>
      <dc:date>2021-10-29T03:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Spark adding NUL</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12147#M7001</link>
      <description>&lt;P&gt;Are you writing the actual json string in a csv, or do you flatten the json into a table structure and write that to csv? &lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 08:14:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12147#M7001</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2021-10-29T08:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Spark adding NUL</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12148#M7002</link>
      <description>&lt;P&gt;I have a value in my dataframe column  in the format of Json string, I am trying to write the  dataframe to the csv&lt;/P&gt;&lt;P&gt;_________&lt;/P&gt;&lt;P&gt;Value&lt;/P&gt;&lt;P&gt;__________&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;{"Name": ABC, "age": 12}&lt;/P&gt;&lt;P&gt;__________​&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 09:09:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12148#M7002</guid>
      <dc:creator>vasu_sethia</dc:creator>
      <dc:date>2021-10-29T09:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Spark adding NUL</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12149#M7003</link>
      <description>&lt;P&gt;Hard to tell without having the code, but it might be the separator for the csv?  You do have comma's in the string, and comma is the default separator for csv.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 11:30:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12149#M7003</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2021-10-29T11:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Spark adding NUL</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12150#M7004</link>
      <description>&lt;P&gt;df.coalesce(1).write.format("csv").option("header", false).option("quote", "").save(path)​&lt;/P&gt;&lt;P&gt;This is the code and yes I do have comma in the string ​&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 12:10:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12150#M7004</guid>
      <dc:creator>vasu_sethia</dc:creator>
      <dc:date>2021-10-29T12:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Spark adding NUL</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12151#M7005</link>
      <description>&lt;P&gt;I mean the code for 'df'.&lt;/P&gt;&lt;P&gt;Can you try to write with option("sep", ";")?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 13:41:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12151#M7005</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2021-10-29T13:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Spark adding NUL</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12152#M7006</link>
      <description>&lt;P&gt;Thank you so much, this worked for me​&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 15:11:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12152#M7006</guid>
      <dc:creator>vasu_sethia</dc:creator>
      <dc:date>2021-10-29T15:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Spark adding NUL</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12153#M7007</link>
      <description>&lt;P&gt;hi @Vasu Sethia​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Werners' response fully answered your question, would you be happy to mark the answer as best so that others can quickly find the solution?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 23:04:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-adding-nul/m-p/12153#M7007</guid>
      <dc:creator>jose_gonzalez</dc:creator>
      <dc:date>2021-10-29T23:04:28Z</dc:date>
    </item>
  </channel>
</rss>

