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: 

Mismatch of Columns in databricks vs Athena.

DavidSzedlak
New Contributor

We are trying to expose one of our external tables to databricks via unity catalog, but we are having an issue with column mismatch, ie few of our columns are not visible in databricks. Is this a known issue? If so, can anyone best advise me on where to go from here? Many thanks!

2 REPLIES 2

Advika
Databricks Employee
Databricks Employee

Hello @DavidSzedlak!

This could be due to a schema mismatch, which occurs when the data files evolve but the table's metadata isn’t updated. Try running: MSCK REPAIR TABLE <table-name> SYNC METADATA
This should refresh the schema and make the missing columns visible.

LRALVA
New Contributor III

Hi @DavidSzedlak ,

1.  Unity Catalog caches metadata for performance. If new columns were added to the source table after the initial creation, they may not be reflected.
Run the following command to refresh metadata: ALTER TABLE <catalog>.<schema>.<table_name> REFRESH;

2.  Check Column Mapping in External Table Definition:
    Verify the external table definition in Unity Catalog. Column definitions in Unity Catalog may differ from the         underlying file structure.
    Use the MSCK REPAIR TABLE command if new columns were added to the data source but are missing in the metadata.
Ex: MSCK REPAIR TABLE <catalog>.<schema>.<table_name>;

3.  Review Permissions and Access Control:
Missing columns could also result from insufficient permissions.
Confirm the user/role has the appropriate access rights.
Command to Check Grants: 
Ex:  SHOW GRANTS ON TABLE <catalog>.<schema>.<table_name

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now