<?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: How do we get logs on read queries from delta lake in Databricks? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-do-we-get-logs-on-read-queries-from-delta-lake-in-databricks/m-p/20720#M14022</link>
    <description>&lt;P&gt;The header question seems different than your body question. I am assuming that you are asking how to only get a single CSV file when writing? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do so you should use the coalesce:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;df.coalesce(1).write.format("csv").mode("overwrite").save(dstPath)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will save a single CSV file underneath the directory that you provide. If you want to have a specific name of the file then you will need to rename it. You could just use dbutils.fs.cp() to copy the file with a new name or you can use Python "os" library to rename it. &lt;/P&gt;</description>
    <pubDate>Thu, 24 Jun 2021 17:53:04 GMT</pubDate>
    <dc:creator>Ryan_Chynoweth</dc:creator>
    <dc:date>2021-06-24T17:53:04Z</dc:date>
    <item>
      <title>How do we get logs on read queries from delta lake in Databricks?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-do-we-get-logs-on-read-queries-from-delta-lake-in-databricks/m-p/20719#M14021</link>
      <description>&lt;P&gt;I've tried with :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;df.write.mode("overwrite").format("com.databricks.spark.csv").option("header","true").csv(dstPath)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;df.write.format("csv").mode("overwrite").save(dstPath)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but now I have 10 csv files but I need one file and name it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 15:12:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-do-we-get-logs-on-read-queries-from-delta-lake-in-databricks/m-p/20719#M14021</guid>
      <dc:creator>User16790091296</dc:creator>
      <dc:date>2021-06-24T15:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do we get logs on read queries from delta lake in Databricks?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-do-we-get-logs-on-read-queries-from-delta-lake-in-databricks/m-p/20720#M14022</link>
      <description>&lt;P&gt;The header question seems different than your body question. I am assuming that you are asking how to only get a single CSV file when writing? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do so you should use the coalesce:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;df.coalesce(1).write.format("csv").mode("overwrite").save(dstPath)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will save a single CSV file underneath the directory that you provide. If you want to have a specific name of the file then you will need to rename it. You could just use dbutils.fs.cp() to copy the file with a new name or you can use Python "os" library to rename it. &lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 17:53:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-do-we-get-logs-on-read-queries-from-delta-lake-in-databricks/m-p/20720#M14022</guid>
      <dc:creator>Ryan_Chynoweth</dc:creator>
      <dc:date>2021-06-24T17:53:04Z</dc:date>
    </item>
  </channel>
</rss>

