<?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 Column partitioning is not working in delta live table when `columnMapping` table property is enabled. in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/column-partitioning-is-not-working-in-delta-live-table-when/m-p/32331#M23556</link>
    <description>&lt;P&gt;I'm trying to create delta live table on top of json files placed in azure blob. The json files contains white spaces in column names instead of renaming I tried `columnMapping` table property which let me create the table with spaces but the column partitioning of column `date` created was not as expected meaning it is supposed to create partitions like `dates=2022-01-01` instead it created bunch of directories like `AA`, `AB`, `CL` ... etc and parquet files inside it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SET `spark.sql.legacy.timeParserPolicy`=`LEGACY`
&amp;nbsp;
CREATE OR REFRESH STREAMING LIVE TABLE abcdata
USING DELTA
TBLPROPERTIES ("quality" = "bronze",
'delta.minReaderVersion' = '2',
'delta.minWriterVersion' = '5',
'delta.columnMapping.mode' = 'name')
LOCATION "dbfs:/mnt/abcdata"
AS SELECT
*,
 input_file_name() AS source_file_name
FROM cloud_files("dbfs:/json/data", "json",map("cloudFiles.inferColumnTypes", "true","cloudFiles.rescuedDataColumn", "_rescued_data","cloudFiles.schemaEvolutionMode", "rescue","multiLine","true"))
&amp;nbsp;
CREATE OR REFRESH live table `abcdatafinal`
USING DELTA
TBLPROPERTIES ("quality" = "silver",
'delta.minReaderVersion' = '2',
'delta.minWriterVersion' = '5',
'delta.columnMapping.mode' = 'name')
LOCATION "dbfs:/mnt/abcdatafinal"
AS
select 
*,
to_date(to_timestamp(from_unixtime(unix_timestamp(TimeStamp,'MM/dd/yyyy hh:mm:ss.SSS aa'),'yyyy-MM-dd HH:mm:ss'))) as dates
from live.abcdata;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What am I doing wrong here ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the first streaming live table was not at all partitioned but the table path contains directories like I said above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance!&lt;/P&gt;</description>
    <pubDate>Thu, 08 Sep 2022 03:33:36 GMT</pubDate>
    <dc:creator>Vickyster</dc:creator>
    <dc:date>2022-09-08T03:33:36Z</dc:date>
    <item>
      <title>Column partitioning is not working in delta live table when `columnMapping` table property is enabled.</title>
      <link>https://community.databricks.com/t5/data-engineering/column-partitioning-is-not-working-in-delta-live-table-when/m-p/32331#M23556</link>
      <description>&lt;P&gt;I'm trying to create delta live table on top of json files placed in azure blob. The json files contains white spaces in column names instead of renaming I tried `columnMapping` table property which let me create the table with spaces but the column partitioning of column `date` created was not as expected meaning it is supposed to create partitions like `dates=2022-01-01` instead it created bunch of directories like `AA`, `AB`, `CL` ... etc and parquet files inside it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SET `spark.sql.legacy.timeParserPolicy`=`LEGACY`
&amp;nbsp;
CREATE OR REFRESH STREAMING LIVE TABLE abcdata
USING DELTA
TBLPROPERTIES ("quality" = "bronze",
'delta.minReaderVersion' = '2',
'delta.minWriterVersion' = '5',
'delta.columnMapping.mode' = 'name')
LOCATION "dbfs:/mnt/abcdata"
AS SELECT
*,
 input_file_name() AS source_file_name
FROM cloud_files("dbfs:/json/data", "json",map("cloudFiles.inferColumnTypes", "true","cloudFiles.rescuedDataColumn", "_rescued_data","cloudFiles.schemaEvolutionMode", "rescue","multiLine","true"))
&amp;nbsp;
CREATE OR REFRESH live table `abcdatafinal`
USING DELTA
TBLPROPERTIES ("quality" = "silver",
'delta.minReaderVersion' = '2',
'delta.minWriterVersion' = '5',
'delta.columnMapping.mode' = 'name')
LOCATION "dbfs:/mnt/abcdatafinal"
AS
select 
*,
to_date(to_timestamp(from_unixtime(unix_timestamp(TimeStamp,'MM/dd/yyyy hh:mm:ss.SSS aa'),'yyyy-MM-dd HH:mm:ss'))) as dates
from live.abcdata;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What am I doing wrong here ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the first streaming live table was not at all partitioned but the table path contains directories like I said above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 03:33:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/column-partitioning-is-not-working-in-delta-live-table-when/m-p/32331#M23556</guid>
      <dc:creator>Vickyster</dc:creator>
      <dc:date>2022-09-08T03:33:36Z</dc:date>
    </item>
  </channel>
</rss>

