<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Managed Delta Table Error in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Managed-Delta-Table-Error/m-p/4051951#M3171</link>
    <description>&lt;P&gt;Or maybe this could work (I asked ChatGPT how to create a similar table with SQL syntax)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%%sql&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Step 1: Create the Table&lt;/P&gt;&lt;P&gt;CREATE TABLE watermark (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; id INT,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; schema_name VARCHAR(255),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; table_name VARCHAR(255),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; watermark_value TIMESTAMP,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; full_path VARCHAR(255)&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Step 2: Insert Data into the Table&lt;/P&gt;&lt;P&gt;INSERT INTO watermark (id, schema_name, table_name, watermark_value, full_path)&lt;/P&gt;&lt;P&gt;VALUES (1, 'lorem', 'ipsum', '0001-01-01 00:00:00', NULL);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Step 3: Update the `full_path` Column&lt;/P&gt;&lt;P&gt;UPDATE watermark&lt;/P&gt;&lt;P&gt;SET full_path = schema_name || '.'&lt;/P&gt;&lt;P&gt;|| table_name;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Jul 2024 14:41:47 GMT</pubDate>
    <dc:creator>frithjof_v</dc:creator>
    <dc:date>2024-07-20T14:41:47Z</dc:date>
    <item>
      <title>Managed Delta Table Error</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Managed-Delta-Table-Error/m-p/4051646#M3167</link>
      <description>&lt;P&gt;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&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="smpa01_1-1721451973020.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1135599i952B45CBF003104C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="smpa01_1-1721451973020.png" alt="smpa01_1-1721451973020.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;%%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")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I satisfy &lt;STRONG&gt;`No Delta transaction log entries were found ` &lt;/STRONG&gt;req&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 05:08:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Managed-Delta-Table-Error/m-p/4051646#M3167</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2024-07-20T05:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Managed Delta Table Error</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Managed-Delta-Table-Error/m-p/4051933#M3170</link>
      <description>&lt;P&gt;Does it work if you use this code below?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from pyspark.sql.types import *&lt;/P&gt;&lt;P&gt;from pyspark.sql import functions as sf&lt;/P&gt;&lt;P&gt;from datetime import datetime&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;schema = StructType([&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; StructField('id',IntegerType(), True),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; StructField('schema_name', StringType(), True),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; StructField('table_name', StringType(), True),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; StructField('watermark_value', TimestampType(), True),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; StructField('full_path', StringType(), True)&lt;/P&gt;&lt;P&gt;])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;row_one = [&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; (1, 'lorem', 'ipsum', datetime(1, 1, 1, 0, 0, 0), None),&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;df_one = spark.createDataFrame(row_one, schema)&lt;/P&gt;&lt;P&gt;df_two = df_one.withColumn('full_path', sf.concat(sf.col('schema_name'),sf.lit('.'),sf.col('table_name')))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;df_two.show()&lt;/P&gt;&lt;P&gt;df_two.write.mode("overwrite").saveAsTable("watermark")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think you need to specify %%pyspark as this is the default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think you need to initalize the spark session in your code in Fabric notebooks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you need to add .mode("overwrite") or .mode("append") in the saveAsTable expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, does your code run without errors if you remove line 28 in your code? (The saveAsTable line)&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 14:52:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Managed-Delta-Table-Error/m-p/4051933#M3170</guid>
      <dc:creator>frithjof_v</dc:creator>
      <dc:date>2024-07-20T14:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Managed Delta Table Error</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Managed-Delta-Table-Error/m-p/4051951#M3171</link>
      <description>&lt;P&gt;Or maybe this could work (I asked ChatGPT how to create a similar table with SQL syntax)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%%sql&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Step 1: Create the Table&lt;/P&gt;&lt;P&gt;CREATE TABLE watermark (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; id INT,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; schema_name VARCHAR(255),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; table_name VARCHAR(255),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; watermark_value TIMESTAMP,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; full_path VARCHAR(255)&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Step 2: Insert Data into the Table&lt;/P&gt;&lt;P&gt;INSERT INTO watermark (id, schema_name, table_name, watermark_value, full_path)&lt;/P&gt;&lt;P&gt;VALUES (1, 'lorem', 'ipsum', '0001-01-01 00:00:00', NULL);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Step 3: Update the `full_path` Column&lt;/P&gt;&lt;P&gt;UPDATE watermark&lt;/P&gt;&lt;P&gt;SET full_path = schema_name || '.'&lt;/P&gt;&lt;P&gt;|| table_name;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 14:41:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Managed-Delta-Table-Error/m-p/4051951#M3171</guid>
      <dc:creator>frithjof_v</dc:creator>
      <dc:date>2024-07-20T14:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Managed Delta Table Error</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Managed-Delta-Table-Error/m-p/4052214#M3177</link>
      <description>&lt;P&gt;This issue can be solved by using tablebuilder api&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jul 2024 05:35:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Managed-Delta-Table-Error/m-p/4052214#M3177</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2024-07-21T05:35:14Z</dc:date>
    </item>
  </channel>
</rss>

