cancel
Showing results for 
Search instead for 
Did you mean: 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group