Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
j_doe
Regular Visitor

MS-Fabric Cannot Preview or Query Delta Table

I am generating delta tables using data from a JSON file, pyspark, and a notebook. Everything goes by smoothly; the table creation (If it doesn't exist already) and the table overwriting. However, I can't preview the data or query it at all with SQL. If I try, I instead get the following error:

"[DELTA_READ_TABLE_WITHOUT_COLUMNS] You are trying to read a Delta table [Table Here] that does not have any columns."

This is strange, as when I check the amount of columns in the data-frame before overwriting the table using "len(df.columns)", it is considerably larger than zero.

What is also strange, is that sometimes I can view and query a table that was created in the same exact manner as a table that is problematic. It's sporradic - even with the same, unchanged data.

Looking in the lake warehouse, I find a message with a red circle and a white 'X' next to it:
 j_doe_0-1734028027891.png


And when I view the details:

j_doe_1-1734028075843.png
...
j_doe_2-1734028109082.png
This seems somewhat similar to a known issue I found here:
https://learn.microsoft.com/en-us/fabric/get-started/known-issues/known-issue-891-warehouse-tables-n...

I also notice this next to some (But not all) of the table names:

j_doe_3-1734028530727.png


When I hover over it, I get a message that says: "Columns of the specified data types are not supported for...", where it then continues on to list some columns and their (presumed) types. A preview of the table can be seen.


Is the issue I'm having related to the known issue linked above and - if so - is there anything that can be done to remedy this issue? Is it possible the schema is not being inferred correctly and that could be causing all of these issues?

4 REPLIES 4
j_doe
Regular Visitor

Hi @v-zhangtin-msft,

I don't believe "Lakehouse schemas (Public Preview)" is enabled on the lakehouse I am working with, so It likely doesn't match unfortunately.

Thank you for your time,

j_doe

rohit1991
Super User
Super User

Root Causes in Power BI Service:

  1. Schema inference issues or unsupported data types in Delta tables.
  2. Metadata refresh problems between Fabric Lakehouse and Power BI.
  3. Known bugs in Microsoft Fabric integration.

     

  4.  
  5.  
  6. Solutions:

    1. Define Schema Explicitly in PySpark:


    from pyspark.sql.types import StructType, StructField, StringType, IntegerType
    schema = StructType([
    StructField("column1", StringType(), True),
    StructField("column2", IntegerType(), True)
    ])
    df = spark.read.json("path_to_json", schema=schema)
    df.write.format("delta").mode("overwrite").save("path_to_table"

     

  7.  
  8. Avoid Unsupported Data Types:

    • Flatten nested types or use String, Int, or Date.
    • Use Direct Lake Connection:
      • Prefer Direct Lake over Warehouse connections in Power BI for better compatibility.

Alright, I'll look into defining the schema explicitly. Thank you for your time!

v-zhangtin-msft
Community Support
Community Support

Hi, @j_doe 

 

Check out this link, does your situation match this?

Known issue - Tables aren't visible in the SQL analytics endpoint in schema enabled lakehouse - Micr...

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.