<?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: Databricks Delta MERGE fails with row filter — “Cannot find column index for attribute 'account_ in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/databricks-delta-merge-fails-with-row-filter-cannot-find-column/m-p/128872#M48358</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/179798"&gt;@vim17&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;It might be due to the limitation mentioned here: &lt;A href="https://docs.azure.cn/en-us/databricks/tables/row-and-column-filters#:~:text=MERGE%20statements%20do%20not%20support%20tables%20with%20row%20filter%20or%20column%2Dmask%20policies%20that%20contain%20nesting%2C%20aggregations%2C%20windows%2C%20limits%2C%20or%20non%2Ddeterministic%20functions." target="_self"&gt;Row filters and column masks&lt;/A&gt;&lt;BR /&gt;You could try simplifying the row filter function and then re-running the merge&lt;/P&gt;</description>
    <pubDate>Tue, 19 Aug 2025 14:11:40 GMT</pubDate>
    <dc:creator>SP_6721</dc:creator>
    <dc:date>2025-08-19T14:11:40Z</dc:date>
    <item>
      <title>Databricks Delta MERGE fails with row filter — “Cannot find column index for attribute 'account_id'”</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-delta-merge-fails-with-row-filter-cannot-find-column/m-p/128674#M48313</link>
      <description>&lt;P&gt;Problem:&lt;BR /&gt;I’m getting the below error when performing a MERGE (or any other DML command) on a Delta table with a row filter in Databricks.&lt;BR /&gt;Error: Cannot find column index for attribute 'account_id#48219' in: Map(transaction_id#47260 -&amp;gt; 5, file_path#47253 -&amp;gt; 0, numPhysicalRecords#49686L -&amp;gt; 3, defaultRowCommitVersion#47262L -&amp;gt; 7, version#47265L -&amp;gt; 9, size#47255L -&amp;gt; 1, account_number#48983 -&amp;gt; 10, baseRowId#47261L -&amp;gt; 6, transaction_tags#47259 -&amp;gt; 4, modificationTime#47256L -&amp;gt; 2, partitionValues_parsed#47264 -&amp;gt; &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I’ve verified that account_id is present in the table. For some reason, it is not able to access it in both cases where a row filter allows/blocks data from the user.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Details:&lt;BR /&gt;I’ve created a minimal repro that can demonstrate the issue, please find it below.&lt;BR /&gt;merge operation:&lt;BR /&gt;target_txns.alias("target") \&lt;BR /&gt;.merge(source_txns.alias("source"), merge_cond) \&lt;BR /&gt;.whenMatchedUpdateAll() \&lt;BR /&gt;.whenNotMatchedInsertAll() \&lt;BR /&gt;.execute()&lt;/P&gt;&lt;P&gt;The target table has this row filter:&lt;BR /&gt;CREATE FUNCTION fin_data.customer_db.filter_account(acc_id STRING) RETURNS BOOLEAN&lt;BR /&gt;RETURN acc_id IN (&lt;BR /&gt;SELECT account_id&lt;BR /&gt;FROM fin_data.customer_db.authorized_accounts&lt;BR /&gt;WHERE email = current_user()&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;facing this error, Any leads/help on this would be appreciated.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Aug 2025 15:23:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-delta-merge-fails-with-row-filter-cannot-find-column/m-p/128674#M48313</guid>
      <dc:creator>vim17</dc:creator>
      <dc:date>2025-08-17T15:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Delta MERGE fails with row filter — “Cannot find column index for attribute 'account_</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-delta-merge-fails-with-row-filter-cannot-find-column/m-p/128872#M48358</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/179798"&gt;@vim17&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;It might be due to the limitation mentioned here: &lt;A href="https://docs.azure.cn/en-us/databricks/tables/row-and-column-filters#:~:text=MERGE%20statements%20do%20not%20support%20tables%20with%20row%20filter%20or%20column%2Dmask%20policies%20that%20contain%20nesting%2C%20aggregations%2C%20windows%2C%20limits%2C%20or%20non%2Ddeterministic%20functions." target="_self"&gt;Row filters and column masks&lt;/A&gt;&lt;BR /&gt;You could try simplifying the row filter function and then re-running the merge&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 14:11:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-delta-merge-fails-with-row-filter-cannot-find-column/m-p/128872#M48358</guid>
      <dc:creator>SP_6721</dc:creator>
      <dc:date>2025-08-19T14:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Delta MERGE fails with row filter — “Cannot find column index for attribute 'account_</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-delta-merge-fails-with-row-filter-cannot-find-column/m-p/130064#M48679</link>
      <description>&lt;P&gt;I’ve verified that row filter or column-mask policies do not contain nesting, aggregations, windows, limits, or non-deterministic functions&lt;/P&gt;</description>
      <pubDate>Thu, 28 Aug 2025 16:14:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-delta-merge-fails-with-row-filter-cannot-find-column/m-p/130064#M48679</guid>
      <dc:creator>vim17</dc:creator>
      <dc:date>2025-08-28T16:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Delta MERGE fails with row filter — “Cannot find column index for attribute 'account_</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-delta-merge-fails-with-row-filter-cannot-find-column/m-p/130128#M48710</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/179798"&gt;@vim17&lt;/a&gt;, I see "&lt;SPAN&gt;partitionValues_parsed#47264&lt;/SPAN&gt;" in the Error trace. Is the table partitioned, by any chance?&amp;nbsp;&lt;BR /&gt;Which DBR version are you using?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 09:15:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-delta-merge-fails-with-row-filter-cannot-find-column/m-p/130128#M48710</guid>
      <dc:creator>Amruth_Ashok</dc:creator>
      <dc:date>2025-08-29T09:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Delta MERGE fails with row filter — “Cannot find column index for attribute 'account_</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-delta-merge-fails-with-row-filter-cannot-find-column/m-p/134899#M50224</link>
      <description>&lt;P&gt;Yes, the table is partitioned on transaction_date.&lt;/P&gt;&lt;P&gt;Sample target table schema:&lt;BR /&gt;CREATE TABLE fin_data.customer_db.account_transactions (&lt;BR /&gt;transaction_id STRING,&lt;BR /&gt;account_id STRING,&lt;BR /&gt;transaction_date DATE,&lt;BR /&gt;transaction_type STRING,&lt;BR /&gt;transaction_amount DECIMAL(18,2),&lt;BR /&gt;currency STRING,&lt;BR /&gt;merchant_name STRING,&lt;BR /&gt;merchant_category STRING,&lt;BR /&gt;transaction_tags ARRAY&amp;lt;STRING&amp;gt;,&lt;BR /&gt;modificationTime TIMESTAMP&lt;BR /&gt;)&lt;BR /&gt;USING DELTA&lt;BR /&gt;PARTITIONED BY (transaction_date)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Target table sample data&lt;BR /&gt;target_txns = spark.createDataFrame([&lt;BR /&gt;("txn_001", "ACC123", "2025-08-01", "DEBIT", 150.00, "USD", "Amazon", "E-commerce", ["online"], "2025-08-01 10:00:00"),&lt;BR /&gt;("txn_002", "ACC124", "2025-08-02", "CREDIT", 2000.00, "USD", "Payroll", "Salary", ["monthly"], "2025-08-02 09:00:00")&lt;BR /&gt;], ["transaction_id", "account_id", "transaction_date", "transaction_type", "transaction_amount", "currency", "merchant_name", "merchant_category", "transaction_tags", "modificationTime"])&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Source table sample data&lt;BR /&gt;source_txns = spark.createDataFrame([&lt;BR /&gt;("txn_003", "ACC123", "2025-08-03", "DEBIT", 75.00, "USD", "Starbucks", "Cafe", ["food"], "2025-08-03 08:00:00"),&lt;BR /&gt;("txn_004", "ACC125", "2025-08-04", "DEBIT", 300.00, "USD", "Best ", "Electronics", ["gadget"], "2025-08-04 15:00:00")&lt;BR /&gt;], ["transaction_id", "account_id", "transaction_date", "transaction_type", "transaction_amount", "currency", "merchant_name", "merchant_category", "transaction_tags", "modificationTime"])&lt;BR /&gt;Currently, we are using 15.4, 16.4&amp;nbsp;DBR&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2025 17:58:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-delta-merge-fails-with-row-filter-cannot-find-column/m-p/134899#M50224</guid>
      <dc:creator>vim17</dc:creator>
      <dc:date>2025-10-14T17:58:11Z</dc:date>
    </item>
  </channel>
</rss>

