cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

No Data for External Table from Blob Storage

JOFinancial
New Contributor

Hi All,

I am trying to create an external table from a Azure Blob storage container.  I recieve no errors, but there is no data in the table.  The Blob Storage contains 4 csv files with the same columns and about 10k rows of data.  Am I missing something?

create table users
(column1 string,
column2 string,
column3 string)
using csv
location 'abfss://path/to/blob/folder'
2 REPLIES 2

Hkesharwani
Contributor II

Hi, 
The code looks completely fine. please check if you have any other delimiter other than , .If your CSV files use a different delimiter, you can specify it in the table definition using the OPTIONS clause.
Just to confirm I created a sample table and that worked fine for me.

Hkesharwani_0-1715955604153.png

Just to confirm if you have read access to the csv.  try this

display(spark.read.csv("abfss://raw@finaldatabricks.dfs.core.windows.net/2021-03-21/circuits.csv"))



Harshit Kesharwani
Self-taught Data Engineer | Seeking Remote Full-time Opportunities

Kaniz_Fatma
Community Manager
Community Manager

Hi @JOFinancial

  • Make sure that the CSV files in your Azure Blob storage container use the correct delimiter (usually a comma) and have consistent column names. Any variation in the column names or the delimiter could cause issues.
  • Verify that the folder structure in your Blob storage matches the specified location in your CREATE TABLE statement. Ensure that the path is correct and that the files are accessible.
  • Confirm that the service principal or account youโ€™re using to access the Blob storage has the necessary permissions to read the files. You might need to grant read access to the storage account or container.
  • Manually inspect the CSV files to ensure they contain valid data. Sometimes issues arise due to unexpected characters or formatting errors within the files.
  • If youโ€™re using Azure Databricks, ensure that the cluster configuration is set up correctly. Check if the cluster has network access to the Blob storage.
  • If the data is distributed unevenly across the CSV files (e.g., one file has significantly more rows than others), it can cause data skew. Consider consolidating the data into fewer files or evenly distributing it.

  • Verify that the data types specified in your CREATE TABLE statement match the actual data types in the CSV files. Mismatched data types can lead to empty results.
  • Use the SELECT * FROM users query to preview the data in the external table. If it returns no rows, there might be an issue with the data or the table definition.

Feel free to review these points, and let me know if any of them help resolve the issue. If not, we can explore further options!

 

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!