Hi
I am able to create a delta table after writing messages to the delta location:
scala> batchDF.selectExpr("Col_A", Col _B").write.format("delta").mode("overwrite").save("hdfs://hdfs-host:9000/tmp/kafka-message-without-partition-by")
scala> sql("CREATE TABLE kafka_topic USING DELTA LOCATION 'hdfs://hdfs-host:9000/tmp/kafka-message-without-partition-by'")
However, if i partition the dataframe with Col_A and then try to create the table using spark sql, i am getting the following error:
scala> batchDF.selectExpr("Col_A", Col _B").write.format("delta").partitionBy("Col_A").mode("overwrite").save("hdfs://hdfs-host:9000/tmp/kafka-message-with-partition-by")
scala> sql("CREATE TABLE kafka_topic_with_partition_by USING DELTA LOCATION 'hdfs://hdfs-host:9000/tmp/kafka-message-with-partition-by'")
org.apache.spark.sql.AnalysisException:
You are trying to create an external table `default`.`kafka_topic`
from `hdfs-host::9000/tmp/kafka-message-with-partition-by` using Delta Lake, but there is no transaction log present at
`hdfs://1hdfs-host:9000/tmp/kafka-message-with-partition-by/_delta_log`. Check the upstream job to make sure that it is writing using
format("delta") and that the path is the root of the table.
I found that, the _delta_log folder is not created in the designated path.Tried with freshly created delta path(folders) but the result is same.
Spark: 3.0.2
Delta : 0.7.0
Like to know, what is the root cause for the issue.
Regards