<?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: Partitioned delta parquet files don't import into tables in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Partitioned-delta-parquet-files-don-t-import-into-tables/m-p/3988582#M2535</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/680346"&gt;@Krumelur&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply.&amp;nbsp;&lt;BR /&gt;Glad to know that you were able to get to a resolution using pyspark. Please continue using Fabric Community on your further queries.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2024 12:21:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-06-12T12:21:30Z</dc:date>
    <item>
      <title>Partitioned delta parquet files don't import into tables</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Partitioned-delta-parquet-files-don-t-import-into-tables/m-p/3986026#M2522</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="18b679e1-9f20-43de-ae9e-b48261f8d31a.jpg" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1114718iD1CF1193EE4C4503/image-size/medium?v=v2&amp;amp;px=400" role="button" title="18b679e1-9f20-43de-ae9e-b48261f8d31a.jpg" alt="18b679e1-9f20-43de-ae9e-b48261f8d31a.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Using Fabric, I created a dataset stored in delta parquet format and partitiones by EventData=YYYY-MM-DD. Then, I'm running a Pyspark script to load this data into "Tables". It will &amp;nbsp;generate a table named "pageview_delta_small" but without any columns. If I create my data without partitions, it will work. What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 12:02:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Partitioned-delta-parquet-files-don-t-import-into-tables/m-p/3986026#M2522</guid>
      <dc:creator>Krumelur</dc:creator>
      <dc:date>2024-06-11T12:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Partitioned delta parquet files don't import into tables</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Partitioned-delta-parquet-files-don-t-import-into-tables/m-p/3988222#M2531</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/680346"&gt;@Krumelur&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thanks for using Fabric Community.&lt;/P&gt;
&lt;P&gt;You can explicitly define the schema for your DataFrame before writing it to the table. This ensures Spark uses the correct schema regardless of the partition data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Define schema as a list of tuples (column_name, data_type)

schema = [("column1", "string"), ("column2", "int"), ...]



# Load your delta parquet data

df = spark.read.format("delta").load("path/to/your/data")



# Write data with explicit schema

df.write.format("delta").option("partitionBy", "EventData").saveAsTable("pageview_delta_small", schema=schema)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Can you please try above code?&lt;BR /&gt;&lt;BR /&gt;Hope this is helpful. Please do let me know incase of further queries.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 09:47:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Partitioned-delta-parquet-files-don-t-import-into-tables/m-p/3988222#M2531</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-12T09:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Partitioned delta parquet files don't import into tables</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Partitioned-delta-parquet-files-don-t-import-into-tables/m-p/3988260#M2532</link>
      <description>&lt;P&gt;Your solution uses Python and I can confirm that it's working fine there, even without specifying a schema.&lt;/P&gt;&lt;P&gt;However, using the SQL syntax, the table will be empty.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 10:02:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Partitioned-delta-parquet-files-don-t-import-into-tables/m-p/3988260#M2532</guid>
      <dc:creator>Krumelur</dc:creator>
      <dc:date>2024-06-12T10:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Partitioned delta parquet files don't import into tables</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Partitioned-delta-parquet-files-don-t-import-into-tables/m-p/3988397#M2533</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/680346"&gt;@Krumelur&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Can you please try below Spark SQL code?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;CREATE TABLE IF NOT EXISTS pageview_delta_small -- Ensure this matches the expected table name

USING DELTA

PARTITIONED BY (EventData) -- Specify the partitioning column

LOCATION '/data/pageviews'; -- Location of your Delta table data

&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 12 Jun 2024 11:23:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Partitioned-delta-parquet-files-don-t-import-into-tables/m-p/3988397#M2533</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-12T11:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Partitioned delta parquet files don't import into tables</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Partitioned-delta-parquet-files-don-t-import-into-tables/m-p/3988441#M2534</link>
      <description>&lt;P&gt;This won't work because:&amp;nbsp;&lt;SPAN&gt;It is not allowed to specify partitioning when the table schema is not defined.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At this point, I just use Python. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 11:38:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Partitioned-delta-parquet-files-don-t-import-into-tables/m-p/3988441#M2534</guid>
      <dc:creator>Krumelur</dc:creator>
      <dc:date>2024-06-12T11:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Partitioned delta parquet files don't import into tables</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Partitioned-delta-parquet-files-don-t-import-into-tables/m-p/3988582#M2535</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/680346"&gt;@Krumelur&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply.&amp;nbsp;&lt;BR /&gt;Glad to know that you were able to get to a resolution using pyspark. Please continue using Fabric Community on your further queries.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 12:21:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Partitioned-delta-parquet-files-don-t-import-into-tables/m-p/3988582#M2535</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-12T12:21:30Z</dc:date>
    </item>
  </channel>
</rss>

