python - 如何使用 python 和 pyspark 获取镶木地板文件的创建日期?
问题描述
如何获取镶木地板文件的创建日期?
他们给了我镶木地板文件,我将它们存储在我的 Google Drive 中进行测试。我正在将 Google Colab 与 Python 和 Pyspark 一起使用。什么是正确的命令?
谢谢
解决方案
我没有尝试过 colab,但 Databricks 以这种方式工作:
import os, time
path = '/local/file.parquet' # if you are on Databricks the adress could be dbfs:/mnt/local so you need replace to /dbfs/mnt/local/file.parquet
stat_info = os.stat(path)
print(stat_info)
print(stat_info.st_mtime)
print(time.ctime(stat_info.st_mtime))
希望对你有用
推荐阅读
- xpath - xquery 随机选择文件而不重复选择
- mongodb - MongoDB中的联合
- angularjs - Angular ng-options 仅在 ng-repeat 在同一模型上运行时才有效
- git - 任何方式来可视化所有 git 分支 - 但随着时间的推移使分支始终保持在同一列中?
- javascript - bio[message.author.id].join(" ") 不是函数
- vb.net - VB如何获取打印PDF文件后的返回值
- python - 将数组附加到不同的数组 N 次(python)
- xcode - iPad 模拟器不启动应用程序
- heroku - 我正在尝试在 heroku 中部署这个应用程序,但它不工作有什么问题?
- python - 无法连接到 SQS 的端点 url