No parent external location found for <S3-location> | External Table in UnityCatalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 05:24 AM
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.
- Labels:
-
External Table
-
Location
-
Unity Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 09:28 AM
In Unity catalog you have to pre-define the EXTERNAL LOCATION (and a STORAGE CREDENTIAL) before you use it this way. Please refer below:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 11:17 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2022 07:33 AM
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2022 10:25 AM
Thanks @Debayan Mukherjee for the response and help- I will certainly try out with multiple External Locations (with separate Storage credentials).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 04:31 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2022 02:11 PM
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?

