delta tables on azure HDInsight with azure blob storage

Viewed 816

I am trying to write a delta table from HDInsight spark 2.4.

I have configured my job by following https://docs.delta.io/latest/delta-storage.html#configure-for-azure-blob-storage

I have following code

myrdd.write().format("delta").mode(SaveMode.Append).partitionBy("col1","col2")
                    .save("wasbs://container@account.blob.core.windows.net/delta/table1");

The write is successful and I see parquet files written on the storage location, but when I look at __deltalog file. I don't see partition info written, see below partitionBy is empty array

{"commitInfo":{"timestamp":1586157735069,"operation":"WRITE","operationParameters":{"mode":"Append","partitionBy":"[]"},"isBlindAppend":true}}

Also, partition info on individual parquet files is missing

{"add":{"path":"part-00000-10341955-1490-4fc4-a66c-e7fdd6765fb2-c000.snappy.parquet","partitionValues":{},"size":10473576,"modificationTime":1586157604000,"dataChange":true}}
{"add":{"path":"part-00001-13651729-a04c-400e-ba42-242df2d0afd4-c000.snappy.parquet","partitionValues":{},"size":3884853,"modificationTime":1586157734000,"dataChange":true}}
{"add":{"path":"part-00002-dc29cc35-ef55-4f71-8195-927d76867195-c000.snappy.parquet","partitionValues":{},"size":2449481,"modificationTime":1586157371000,"dataChange":true}}
{"add":{"path":"part-00003-0a8028fa-e910-420b-aa82-b85f4ee1ce4a-c000.snappy.parquet","partitionValues":{},"size":2680111,"modificationTime":1586157441000,"dataChange":true}}
{"add":{"path":"part-00004-414dc827-2860-44f2-82ff-67e7c6f53e50-c000.snappy.parquet","partitionValues":{},"size":3321879,"modificationTime":1586157381000,"dataChange":true}}
{"add":{"path":"part-00005-b7bb3b28-a78a-4733-be54-e30d88b8d360-c000.snappy.parquet","partitionValues":{},"size":4634113,"modificationTime":1586157618000,"dataChange":true}}

I pass following packages to my spark submit

io.delta:delta-core_2.11:0.5.0,org.apache.hadoop:hadoop-azure:3.2.0

Let me know, If I am missing something or interpreting incorrectly.

1 Answers

Per delta lake documentation, support for delta lake is available from spark version 2.4.2

HDinsight spark released new version in July 2020 which includes spark 2.4.4.

With newer version of HDInsight which comes with spark 2.4.4, I see data getting written with appropriate partitions.

Related