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

60 Days of Data Days! Live and on-demand sessions, challenges, study groups and more! And it's all FREE!. Join now. Learn more

Reply
smpa01
Community Champion
Community Champion

Managed Delta Table Error

I am trying to create a managed table in lakehouse using NB with rows manually entered (SQL equivalent INSERT INTO) but I am getting this following error, i have no idea how to debug this. it seems to create the delta table without any columns

 

smpa01_1-1721451973020.png

 

%%pyspark 
from pyspark.sql import SparkSession 
from pyspark.sql.types import *
from pyspark.sql import functions as sf
from datetime import datetime

# Initialize Spark session 
spark = SparkSession.builder \
    .appName("session_one") \
    .getOrCreate()

schema = StructType([
    StructField('id',IntegerType(), True),
    StructField('schema_name', StringType(), True),
    StructField('table_name', StringType(), True),
    StructField('watermark_value', TimestampType(), True),
    StructField('full_path', StringType(), True)
])

row_one = [
    (1, 'lorem', 'ipsum', datetime(1, 1, 1, 0, 0, 0), None),
]

df_one = spark.createDataFrame(row_one, schema)
df_two = df_one.withColumn('full_path', sf.concat(sf.col('schema_name'),sf.lit('.'),sf.col('table_name')))

df_two.show()
df_two.write.format("delta").saveAsTable("watermark")

 

 

How can I satisfy `No Delta transaction log entries were found ` req


========================
Did I answer your question? Mark my post as a solution!
Proud to be a Super User
My Custom Visualization Projects
• Plotting Live Sound: Live Sound
• Beautiful News: Women in Parliament, Energy Mix, Shrinking Armies
• Visual Capitalist: Working Hrs
• Others: Easing Graph, Animated Calendar
MayViz Submissions
• Week 1: View
• Week 2: View
• Week 3: View
• Week 4: View
========================
1 ACCEPTED SOLUTION
smpa01
Community Champion
Community Champion

This issue can be solved by using tablebuilder api


========================
Did I answer your question? Mark my post as a solution!
Proud to be a Super User
My Custom Visualization Projects
• Plotting Live Sound: Live Sound
• Beautiful News: Women in Parliament, Energy Mix, Shrinking Armies
• Visual Capitalist: Working Hrs
• Others: Easing Graph, Animated Calendar
MayViz Submissions
• Week 1: View
• Week 2: View
• Week 3: View
• Week 4: View
========================

View solution in original post

3 REPLIES 3
smpa01
Community Champion
Community Champion

This issue can be solved by using tablebuilder api


========================
Did I answer your question? Mark my post as a solution!
Proud to be a Super User
My Custom Visualization Projects
• Plotting Live Sound: Live Sound
• Beautiful News: Women in Parliament, Energy Mix, Shrinking Armies
• Visual Capitalist: Working Hrs
• Others: Easing Graph, Animated Calendar
MayViz Submissions
• Week 1: View
• Week 2: View
• Week 3: View
• Week 4: View
========================
frithjof_v
Community Champion
Community Champion

Or maybe this could work (I asked ChatGPT how to create a similar table with SQL syntax)

 

%%sql 

-- Step 1: Create the Table

CREATE TABLE watermark (

    id INT,

    schema_name VARCHAR(255),

    table_name VARCHAR(255),

    watermark_value TIMESTAMP,

    full_path VARCHAR(255)

);

 

-- Step 2: Insert Data into the Table

INSERT INTO watermark (id, schema_name, table_name, watermark_value, full_path)

VALUES (1, 'lorem', 'ipsum', '0001-01-01 00:00:00', NULL);

 

-- Step 3: Update the `full_path` Column

UPDATE watermark

SET full_path = schema_name || '.'

|| table_name;

frithjof_v
Community Champion
Community Champion

Does it work if you use this code below?

 

---------------------------------------------

 

from pyspark.sql.types import *

from pyspark.sql import functions as sf

from datetime import datetime

 

schema = StructType([

    StructField('id',IntegerType(), True),

    StructField('schema_name', StringType(), True),

    StructField('table_name', StringType(), True),

    StructField('watermark_value', TimestampType(), True),

    StructField('full_path', StringType(), True)

])

 

row_one = [

    (1, 'lorem', 'ipsum', datetime(1, 1, 1, 0, 0, 0), None),

]

 

df_one = spark.createDataFrame(row_one, schema)

df_two = df_one.withColumn('full_path', sf.concat(sf.col('schema_name'),sf.lit('.'),sf.col('table_name')))

 

df_two.show()

df_two.write.mode("overwrite").saveAsTable("watermark")

 

-----------------------------------------------

 

I don't think you need to specify %%pyspark as this is the default.

 

I don't think you need to initalize the spark session in your code in Fabric notebooks.

 

Maybe you need to add .mode("overwrite") or .mode("append") in the saveAsTable expression.

 

By the way, does your code run without errors if you remove line 28 in your code? (The saveAsTable line)

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

June Fabric Update Carousel

Fabric Monthly Update - June 2026

Check out the June 2026 Fabric update to learn about new features.