โ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.
โ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:
โ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?
โ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.
โ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).
โ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?
โ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?
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