spark驗證資料夾下檔案數量

2021-09-26 02:52:58 字數 361 閱讀 6457

有個需求,需要判斷資料夾下是否有parquet檔案,但是涉及到中間有一層/id=vin號/檔案目錄,無法用萬用字元、

由此轉化為判斷hdfs資料夾下檔案數量來判斷。

**為

val hadoopfs: filesystem = filesystem.get(spark.sparkcontext.hadoopconfiguration)

val file = hadoopfs.getcontentsummary(new path(inputpath)).getfilecount

if (file > 1)else

file為該檔案加下檔案數量。如果大於1(不光只有_success檔案)則說明跑出來資料了。

MFC如何檢視資料夾下面檔案數量

使用cfilefind cfilefind filefind cstring strpath c 表示要查詢的資料夾位址 cstring strdoc 表示要查詢的檔案字尾型別 cstring strfind strpath strdoc int nfind 0 bool bworking file...

PHP遍歷資料夾下檔案

dir e video 這裡輸入其它路徑 php遍歷資料夾下所有檔案 handle opendir dir.echo 檔案 while false file readdir handle closedir handle 用了這段 遍歷所有檔案,幫我把所有檔名存為乙個陣列。s explode n tr...

C 遍歷資料夾下檔案

那麼到底如何查詢檔案呢?我們需要乙個結構體和幾個大家可能不太熟悉的函式。這些函式和結構體在的標頭檔案中,結構體為struct finddata t 函式為 findfirst findnext和 fineclose。具體如何使用,我會慢慢講來 首先講這個結構體吧 struct finddata t ...