# MERGE with VALUES and MAP's

**URL:** <https://community.dremio.com/t/merge-with-values-and-maps/13305>\
**Category:** Apache Iceberg\
**Created:** [January 23, 2026, 8:54am UTC](https://community.dremio.com/t/merge-with-values-and-maps/13305 "2026-01-23T08:54:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nisden](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/nisden/32/5453_2.png) [@Nisden](https://community.dremio.com/u/Nisden)\
**Post date:** [January 23, 2026, 8:54am UTC](https://community.dremio.com/t/merge-with-values-and-maps/13305/1 "2026-01-23T08:54:00Z")

</div>

I am attempting to use the MERGE statement together with a MAP column from a temporary SELECT/VALUES statement, but I get a strange error.

The error is:  
cast function for type MAP is not defined

The SQL I attempt to use is:

```sql
-- Create table
CREATE TABLE IF NOT EXISTS TestTable
(
    Id VARCHAR,
    Dimensions MAP<VARCHAR, VARCHAR>
);
TRUNCATE TABLE TestTable;

-- Base Data
INSERT INTO TestTable
VALUES ('Number1', MAP['Key1', 'Value1']);

-- Merge
-- ERROR: cast function for type MAP is not defined
MERGE INTO TestTable AS D
USING (
    SELECT *
    FROM (VALUES('Number1', MAP['Key1', 'Value2'])) AS SourceTable(Id, Dimensions)
) AS S
ON (D.Id = S.Id)
WHEN MATCHED THEN UPDATE SET *
WHEN NOT MATCHED THEN INSERT *;

-- Validation
SELECT * FROM TestTable;

```

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [January 23, 2026, 7:41pm UTC](https://community.dremio.com/t/merge-with-values-and-maps/13305/2 "2026-01-23T19:41:37Z")

</div>

@Nisden Any chance you can send the profile?

---

<div class="post-metadata">

**Author:** ![Nisden](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/nisden/32/5453_2.png) [@Nisden](https://community.dremio.com/u/Nisden)\
**Post date:** [January 26, 2026, 8:08am UTC](https://community.dremio.com/t/merge-with-values-and-maps/13305/3 "2026-01-26T08:08:28Z")

</div>

I have sent you the profile as a private message

---

<div class="post-metadata">

**Author:** ![Nisden](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/nisden/32/5453_2.png) [@Nisden](https://community.dremio.com/u/Nisden)\
**Post date:** [February 5, 2026, 9:36am UTC](https://community.dremio.com/t/merge-with-values-and-maps/13305/4 "2026-02-05T09:36:32Z")

</div>

Hi @balaji.ramaswamy

Any updates, or do you want me to open a support ticket instead?

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [February 9, 2026, 12:21am UTC](https://community.dremio.com/t/merge-with-values-and-maps/13305/5 "2026-02-09T00:21:29Z")

</div>

Hi @Nisden Yes, if you have Enterprise support please go ahead and open a support ticket as I am traveling
