<?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 How to read a compressed file in spark if the filename does not include the file extension for that compression format? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-read-a-compressed-file-in-spark-if-the-filename-does-not/m-p/21604#M14746</link>
    <description>&lt;P&gt;For example, let's say I have a file called&amp;nbsp;&lt;/P&gt;&lt;P&gt;some-file&lt;/P&gt;&lt;P&gt;, which is a gzipped text file. If I try&amp;nbsp;&lt;/P&gt;&lt;P&gt;spark.read.text('some-file')&lt;/P&gt;&lt;P&gt;, it will return a bunch of gibberish since it doesn't know that the file is gzipped. I'm looking to manually tell spark the file is gzipped and decode it based on that. I did some searching but don't see a good answer to the question or the answers say you can't.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jun 2021 01:13:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-06-23T01:13:00Z</dc:date>
    <item>
      <title>How to read a compressed file in spark if the filename does not include the file extension for that compression format?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-read-a-compressed-file-in-spark-if-the-filename-does-not/m-p/21604#M14746</link>
      <description>&lt;P&gt;For example, let's say I have a file called&amp;nbsp;&lt;/P&gt;&lt;P&gt;some-file&lt;/P&gt;&lt;P&gt;, which is a gzipped text file. If I try&amp;nbsp;&lt;/P&gt;&lt;P&gt;spark.read.text('some-file')&lt;/P&gt;&lt;P&gt;, it will return a bunch of gibberish since it doesn't know that the file is gzipped. I'm looking to manually tell spark the file is gzipped and decode it based on that. I did some searching but don't see a good answer to the question or the answers say you can't.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 01:13:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-read-a-compressed-file-in-spark-if-the-filename-does-not/m-p/21604#M14746</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-23T01:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to read a compressed file in spark if the filename does not include the file extension for that compression format?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-read-a-compressed-file-in-spark-if-the-filename-does-not/m-p/21605#M14747</link>
      <description>&lt;P&gt;Other than renaming the file, I'm not sure you can do much - figuring out how to read the compressed file happens a bit below Spark, in Hadoop APIs, and looking at the source it seems to definitely key off the file name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If they aren't big files, you can load the bytes of the files with .load("binaryFiles") and then apply a UDF that gunzips the file with a library, and then interpret the bytes as a string. In Scala you can then interpret that as a Dataset[String] and actually pass it to things like spark.read.csv; not sure you can do the same in Python. But that at least gets you the whole text of each file.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 01:32:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-read-a-compressed-file-in-spark-if-the-filename-does-not/m-p/21605#M14747</guid>
      <dc:creator>sean_owen</dc:creator>
      <dc:date>2021-06-23T01:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to read a compressed file in spark if the filename does not include the file extension for that compression format?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-read-a-compressed-file-in-spark-if-the-filename-does-not/m-p/21606#M14748</link>
      <description>&lt;P&gt;The community is field for the approval of the terms. The struggle of&amp;nbsp;&lt;A href="https://www.aussiessay.com/dissertation-help.php" alt="https://www.aussiessay.com/dissertation-help.php" target="_blank"&gt;a great site&lt;/A&gt; is recommend for the norms. The value is suggested for the top of the vital paths for the finding members.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2022 14:24:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-read-a-compressed-file-in-spark-if-the-filename-does-not/m-p/21606#M14748</guid>
      <dc:creator>Francie</dc:creator>
      <dc:date>2022-03-13T14:24:02Z</dc:date>
    </item>
  </channel>
</rss>

