cancel
Showing results for 
Search instead for 
Did you mean: 
Data Governance
cancel
Showing results for 
Search instead for 
Did you mean: 

No parent external location found for <S3-location> | External Table in UnityCatalog

Kanib
New Contributor III

Hi,

We are trying to adopt the Unity Catalog and are testing out creating an External table with some data from the samples catalog that comes along with creating a meta store. The command we are using is:

CREATE TABLE IF NOT EXISTS my_catalog.quickstart_schema.trips_external
LOCATION 's3://somebucket/path'
AS SELECT * from samples.nyctaxi.trips;

When I am running this command- I keep on getting an error

Error in SQL statement: NoParentExternalLocationForPathException: No parent external location found for path 's3://somebucket/path'

I was following the doc: https://docs.databricks.com/data-governance/unity-catalog/create-tables.html#create-a-table-from-the...

but I am not getting any information regarding this. Can someone please help me why is this error coming up?

When I try to read some data from this bucket - I am able to do so - meaning, I have the access to the bucket.

6 REPLIES 6

Debayan
Esteemed Contributor III
Esteemed Contributor III

In Unity catalog you have to pre-define the EXTERNAL LOCATION (and a STORAGE CREDENTIAL) before you use it this way. Please refer below:

https://docs.databricks.com/data-governance/unity-catalog/manage-external-locations-and-credentials....

Kanib
New Contributor III

hey @Debayan Mukherjee​  thanks for the answer.

Yeah, I did not create a pre-defined external location- Does that means, in UC, I can create an external table only using the pre-defined External Location?

Also, if yes, then can I have more than one external Location in the UC?

Debayan
Esteemed Contributor III
Esteemed Contributor III

@Mohammad Shoaib​ Yes, each cloud storage path can be associated with only one external location. If you attempt to create a second external location that references the same path, the command fails.

Kanib
New Contributor III

Thanks @Debayan Mukherjee​  for the response and help- I will certainly try out with multiple External Locations (with separate Storage credentials).

Kanib
New Contributor III

hey @Debayan Mukherjee​ , while testing out the external table - I also wanted to add partitions using the command:

ALTER TABLE mycatalog.kanib.UnacastUSS3TargetMinimised ADD IF NOT EXISTS PARTITION (`year`='2022', `month`='02', `day`='05')

but this is failing with an error:

`AnalysisException: ALTER TABLE (add partition) is not supported in Unity Catalog`

What is the alternative in the case of UC- if any?

If not, then what is the way to tackle this scenario?

Debayan
Esteemed Contributor III
Esteemed Contributor III

Hi @Mohammad Shoaib​ , ALTER TABLE is supported by Unity Catalog, this error is typically due to Network misconfigurations. Could you please check your network configuration and confirm?

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.