<?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: Option &amp;quot;delta.columnMapping.mode&amp;quot;,&amp;quot;name&amp;quot;  introduces unexpected result in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/59601#M31457</link>
    <description>&lt;P&gt;Hello, I'm a bit late to the party, but I'll put that for posterity:&lt;/P&gt;&lt;P&gt;There's a way to rename your weird two letter named folders and still have your table working, but it violates the good practices guidelines suggested by Data Bricks, and I don't think you should really use it, but hey, it works for me.&lt;/P&gt;&lt;P&gt;- After modifying your table, you have to check the _data_log json files for lines that add directories to the table. Look for the lines that start with {"add".&lt;/P&gt;&lt;P&gt;- In it you should check for the "path" parameter which should contain one of your weird two letter named folder followed by the actual file that was added (ex:&amp;nbsp;&lt;SPAN&gt;{"add":{"path":"&lt;STRONG&gt;Mz&lt;/STRONG&gt;/part-00000-493eaa18-4b8c-78ad-907e-g213fc315643.c000.snappy.parquet")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- Rename the&amp;nbsp; weird folder after the partition you wanted (ex:&amp;nbsp;"path":"&lt;STRONG&gt;date=20240207&lt;/STRONG&gt;/part-00000-493eaa18-4b8c-78ad-907e-g213fc315643.c000.snappy.parquet")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Then go to your weird folder and rename it with the same name so your delta log can find it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you have multiple weird folders for the same partition, create your new folder first, then move the files from the weird folders to the new one (and you can delete the empty weird folders afterward).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can automate that with a python notebook so you don't have to do all of this by hand everytime you change your table, and add the notebook at the end of your Work Flows or other notebooks to be sure to never skip any waird directories.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now your table should be good and you can do queries. I mean it was already good, but now you can easily find your datas with your file explorer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Once again, I'm pretty sure that's not a safe method to do that (cuz don't mess with the logs), and you probably should just be content with weirdly named folders, but if your data treatment need the right folder names, then this works just fine.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Feb 2024 13:24:26 GMT</pubDate>
    <dc:creator>CkoockieMonster</dc:creator>
    <dc:date>2024-02-07T13:24:26Z</dc:date>
    <item>
      <title>Option "delta.columnMapping.mode","name"  introduces unexpected result</title>
      <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29132#M20889</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I am trying to write and create a delta table by enable "delta.columnMapping.mode","name", and the partition is date. But I found that when I enable this option, the partition folder name is not date any more while it is some random two letters.&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1401iA5E40C10DA1EEAD5/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;ZQ&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 12:35:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29132#M20889</guid>
      <dc:creator>zyang</dc:creator>
      <dc:date>2022-10-05T12:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Option "delta.columnMapping.mode","name"  introduces unexpected result</title>
      <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29134#M20891</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I set according to the reference. The first screenshot is reader options. Second screenshot is writer options. The partitioned folder name is random letter not the partitioned date.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1399i11204628F69776F8/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1400i4660D827CAE6243A/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 10:55:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29134#M20891</guid>
      <dc:creator>zyang</dc:creator>
      <dc:date>2022-10-06T10:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Option "delta.columnMapping.mode","name"  introduces unexpected result</title>
      <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29135#M20892</link>
      <description>&lt;P&gt;As a column mapping option, common names will be seen in the metastore / table or after reading the file. Inside the file or partition folder will be mapped values generated by delta. So behavior is as expected.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 11:18:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29135#M20892</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-10-14T11:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Option "delta.columnMapping.mode","name"  introduces unexpected result</title>
      <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29136#M20893</link>
      <description>&lt;P&gt;Hi Hubert,&lt;/P&gt;&lt;P&gt;So it is impossible to get the partitioned folder by date if enabling &lt;B&gt;columnMapping.mode?  &lt;/B&gt;What do you mean by common names?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 12:27:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29136#M20893</guid>
      <dc:creator>zyang</dc:creator>
      <dc:date>2022-10-14T12:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Option "delta.columnMapping.mode","name"  introduces unexpected result</title>
      <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29137#M20894</link>
      <description>&lt;P&gt;It is partitioned by ... mapping value which is mapped to date. &lt;/P&gt;&lt;P&gt;In my opinion, it would be better that mapping could be specified by column (now it is necessary to enable it for all).&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 12:09:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29137#M20894</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-10-20T12:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Option "delta.columnMapping.mode","name"  introduces unexpected result</title>
      <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29139#M20896</link>
      <description>&lt;P&gt;Hi @z yang​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does @Hubert Dudek​&amp;nbsp; and @Kaniz Fatma​&amp;nbsp;'s responses answer your question? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If yes, would you be happy to &lt;B&gt;mark it as best&lt;/B&gt; so that other members can find the solution more quickly? Else, we can help you with more details. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 03:59:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29139#M20896</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-14T03:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Option "delta.columnMapping.mode","name"  introduces unexpected result</title>
      <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29140#M20897</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Hubert Dudek​&amp;nbsp; you mean is this behaviour expected that delta files gets created in a random directory (here it is 4K) in a specified path after enabling 'delta.columnMapping.mode' = 'name' ? any reason why it gets created and is there a way we can avoid it ? Please note- I'm not using any partition as such while writing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1402iDD802BC0835E517F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 09:08:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29140#M20897</guid>
      <dc:creator>ravinchi</dc:creator>
      <dc:date>2022-11-24T09:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Option "delta.columnMapping.mode","name"  introduces unexpected result</title>
      <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29141#M20898</link>
      <description>&lt;P&gt;@Kaniz Fatma​&amp;nbsp;@Debayan Mukherjee​&amp;nbsp;Please check above comment&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 10:10:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29141#M20898</guid>
      <dc:creator>ravinchi</dc:creator>
      <dc:date>2022-11-24T10:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Option "delta.columnMapping.mode","name"  introduces unexpected result</title>
      <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29142#M20899</link>
      <description>&lt;P&gt;No,I don't understand&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2022 06:55:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29142#M20899</guid>
      <dc:creator>zyang</dc:creator>
      <dc:date>2022-11-25T06:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Option "delta.columnMapping.mode","name"  introduces unexpected result</title>
      <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29143#M20900</link>
      <description>&lt;P&gt;I am also facing the same situation. Is there a way to prevent the random subdirectories from appearing when enabling 'delta.columnMapping.mode' = 'name'&amp;nbsp;? Or is there at least an explanation why they appear? Does this affect performance?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 11:42:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29143#M20900</guid>
      <dc:creator>AleksAngelova</dc:creator>
      <dc:date>2023-04-04T11:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Option "delta.columnMapping.mode","name"  introduces unexpected result</title>
      <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29144#M20901</link>
      <description>&lt;P&gt;@z yang​&amp;nbsp;This is expected with column mapping mode enabled in order to support it. and also Delta doesn't really need the physical folder structure for partitioning it relies on the transaction logs to read the partitions. &lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 09:46:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29144#M20901</guid>
      <dc:creator>Sandeep</dc:creator>
      <dc:date>2023-06-01T09:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Option "delta.columnMapping.mode","name"  introduces unexpected result</title>
      <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29133#M20890</link>
      <description>&lt;P&gt;Hi, @z yang​&amp;nbsp;, Could you please look into the requirements and also go through the below example to user delta column mapping? (ref: &lt;A href="https://docs.databricks.com/delta/delta-column-mapping.html#requirements" alt="https://docs.databricks.com/delta/delta-column-mapping.html#requirements" target="_blank"&gt;https://docs.databricks.com/delta/delta-column-mapping.html#requirements&lt;/A&gt;) &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%sql
ALTER TABLE &amp;lt;table_name&amp;gt; SET TBLPROPERTIES (
  'delta.minReaderVersion' = '2',
  'delta.minWriterVersion' = '5',
  'delta.columnMapping.mode' = 'name'
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also, you can try to rename the column and check, ref: &lt;A href="https://docs.databricks.com/delta/delta-column-mapping.html#rename-a-column" alt="https://docs.databricks.com/delta/delta-column-mapping.html#rename-a-column" target="_blank"&gt;https://docs.databricks.com/delta/delta-column-mapping.html#rename-a-column&lt;/A&gt;. &lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 08:03:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/29133#M20890</guid>
      <dc:creator>Debayan</dc:creator>
      <dc:date>2022-10-06T08:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Option "delta.columnMapping.mode","name"  introduces unexpected result</title>
      <link>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/59601#M31457</link>
      <description>&lt;P&gt;Hello, I'm a bit late to the party, but I'll put that for posterity:&lt;/P&gt;&lt;P&gt;There's a way to rename your weird two letter named folders and still have your table working, but it violates the good practices guidelines suggested by Data Bricks, and I don't think you should really use it, but hey, it works for me.&lt;/P&gt;&lt;P&gt;- After modifying your table, you have to check the _data_log json files for lines that add directories to the table. Look for the lines that start with {"add".&lt;/P&gt;&lt;P&gt;- In it you should check for the "path" parameter which should contain one of your weird two letter named folder followed by the actual file that was added (ex:&amp;nbsp;&lt;SPAN&gt;{"add":{"path":"&lt;STRONG&gt;Mz&lt;/STRONG&gt;/part-00000-493eaa18-4b8c-78ad-907e-g213fc315643.c000.snappy.parquet")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- Rename the&amp;nbsp; weird folder after the partition you wanted (ex:&amp;nbsp;"path":"&lt;STRONG&gt;date=20240207&lt;/STRONG&gt;/part-00000-493eaa18-4b8c-78ad-907e-g213fc315643.c000.snappy.parquet")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Then go to your weird folder and rename it with the same name so your delta log can find it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you have multiple weird folders for the same partition, create your new folder first, then move the files from the weird folders to the new one (and you can delete the empty weird folders afterward).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can automate that with a python notebook so you don't have to do all of this by hand everytime you change your table, and add the notebook at the end of your Work Flows or other notebooks to be sure to never skip any waird directories.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now your table should be good and you can do queries. I mean it was already good, but now you can easily find your datas with your file explorer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Once again, I'm pretty sure that's not a safe method to do that (cuz don't mess with the logs), and you probably should just be content with weirdly named folders, but if your data treatment need the right folder names, then this works just fine.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 13:24:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/option-quot-delta-columnmapping-mode-quot-quot-name-quot/m-p/59601#M31457</guid>
      <dc:creator>CkoockieMonster</dc:creator>
      <dc:date>2024-02-07T13:24:26Z</dc:date>
    </item>
  </channel>
</rss>

