I have created the code below to identify if a directory is a delta table/file/directory. Its kind of brute force, but it appears to work for the most part. I am wondering if there is a more elegant way to determine this. I am in a databricks environment using azure storage. The details of the code are not important, I am just wondering about an algorithm that is better than what I have here. Any help appreciated.
%scala
import scala.collection.mutable._
import spark.sqlContext.implicits._
case class cls(objectKey:String)
val snappyDf = spark.sql("SELECT distinct objectKey FROM silver_latest WHERE objectKey like '%.snappy.parquet%'").as[cls]
val deltaDf = spark.sql("SELECT distinct objectKey FROM silver_latest WHERE objectKey like '%/_delta_log/%'").as[cls]