<?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 Trying to write my dataframe out as a tab separated .txt file but getting an error in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/trying-to-write-my-dataframe-out-as-a-tab-separated-txt-file-but/m-p/18658#M12415</link>
    <description>&lt;P&gt;When I try to save my file I get&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;org.apache.spark.sql.AnalysisException: Text data source supports only a single column, and you have 2 columns.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Is there any way to save a dataframe with more than one column to a .txt file?&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jun 2021 21:10:37 GMT</pubDate>
    <dc:creator>User16826992666</dc:creator>
    <dc:date>2021-06-25T21:10:37Z</dc:date>
    <item>
      <title>Trying to write my dataframe out as a tab separated .txt file but getting an error</title>
      <link>https://community.databricks.com/t5/data-engineering/trying-to-write-my-dataframe-out-as-a-tab-separated-txt-file-but/m-p/18658#M12415</link>
      <description>&lt;P&gt;When I try to save my file I get&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;org.apache.spark.sql.AnalysisException: Text data source supports only a single column, and you have 2 columns.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Is there any way to save a dataframe with more than one column to a .txt file?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 21:10:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/trying-to-write-my-dataframe-out-as-a-tab-separated-txt-file-but/m-p/18658#M12415</guid>
      <dc:creator>User16826992666</dc:creator>
      <dc:date>2021-06-25T21:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to write my dataframe out as a tab separated .txt file but getting an error</title>
      <link>https://community.databricks.com/t5/data-engineering/trying-to-write-my-dataframe-out-as-a-tab-separated-txt-file-but/m-p/18659#M12416</link>
      <description>&lt;P&gt;Would &lt;A href="https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.DataFrameWriter.csv.html#pyspark.sql.DataFrameWriter.csv" alt="https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.DataFrameWriter.csv.html#pyspark.sql.DataFrameWriter.csv" target="_blank"&gt;pyspark.sql.DataFrameWriter.csv&lt;/A&gt; work? You could specify the separator (sep) as tab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;df.write.csv(os.path.join(tempfile.mkdtemp(), 'data'))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 21:45:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/trying-to-write-my-dataframe-out-as-a-tab-separated-txt-file-but/m-p/18659#M12416</guid>
      <dc:creator>sajith_appukutt</dc:creator>
      <dc:date>2021-06-25T21:45:01Z</dc:date>
    </item>
  </channel>
</rss>

