<?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 get the modification time of files from a notebook command? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-get-the-modification-time-of-files-from-a-notebook/m-p/21026#M14264</link>
    <description />
    <pubDate>Wed, 23 Jun 2021 23:51:48 GMT</pubDate>
    <dc:creator>brickster_2018</dc:creator>
    <dc:date>2021-06-23T23:51:48Z</dc:date>
    <item>
      <title>How to get the modification time of files from a notebook command?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-get-the-modification-time-of-files-from-a-notebook/m-p/21026#M14264</link>
      <description />
      <pubDate>Wed, 23 Jun 2021 23:51:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-get-the-modification-time-of-files-from-a-notebook/m-p/21026#M14264</guid>
      <dc:creator>brickster_2018</dc:creator>
      <dc:date>2021-06-23T23:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the modification time of files from a notebook command?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-get-the-modification-time-of-files-from-a-notebook/m-p/21027#M14265</link>
      <description>&lt;P&gt;The below code snippet is useful to get the modification time of files. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%scala
import scala.util.Try
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}
import org.apache.hadoop.io.IOUtils
import java.io.IOException
val conf = sc.hadoopConfiguration
val pathObj=new Path("s3a://my_bucket/location/")
val obj= pathObj.getFileSystem(conf)
val fs = pathObj.getFileSystem(conf)
display(fs.listStatus(pathObj).map(x=&amp;gt;(x.getModificationTime,x.getPath.toString)).toSeq.toDF().withColumn("time",from_unixtime($"_1" /1000)).withColumnRenamed("_2","path").drop("_1"))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 23:53:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-get-the-modification-time-of-files-from-a-notebook/m-p/21027#M14265</guid>
      <dc:creator>brickster_2018</dc:creator>
      <dc:date>2021-06-23T23:53:07Z</dc:date>
    </item>
  </channel>
</rss>

