cancel
Showing results for 
Search instead for 
Did you mean: 
Administration & Architecture
cancel
Showing results for 
Search instead for 
Did you mean: 

Error running history command twice using DeltaTable

mathiaskvist
New Contributor III

Hi

 

I'm using Unity Catalog on Azure with a Managed Identity connected to my Storage Account. I can read and write data without issues, and interact with data using pyspark and SQL.

I can display the history by running a cell with the following code:

from delta.tables import DeltaTable
dt = DeltaTable.forName(spark, "CATALOG.SCHEMA.TABLE")
dt.history().display()

However, if I run the same history display command but in a new cell I get a strange error:

dt.history().display()

I get the following error:

Failure to initialize configuration for storage account NAME.dfs.core.windows.net: Invalid configuration value detected for fs.azure.account.keyInvalid configuration value detected for fs.azure.account.key

However, I can keep running the first cell multiple times and get a result displayed, but running display in a new cell throws the error.

Also trying to persist the history throws an error under certain circumstances:

from delta.tables import DeltaTable
dt = DeltaTable.forName(spark, "CATALOG.SCHEMA.TABLE")

Persist command in a new cell:

a = dt.history().persist()

Throws:

AnalysisException: [RequestId=REQUESTID ErrorClass=INVALID_PARAMETER_VALUE.LOCATION_OVERLAP] Input path url 'abfss://CONTAINER@STORAGEACCOUNT.dfs.core.windows.net/__unitystorage/catalogs/SOMEID/tables/TABLEID' overlaps with managed storage within 'GenerateTemporaryPathCredential' call

I can run the history command in SQL cell multiple times without any issues:

%sql
describe history CATALOG.SCHEMA.TABLE

TLDR: Inconsistent behavior of delta.tables.DeltaTable.history command while sql describe history works

0 REPLIES 0
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.