filipaqsousa1 opened a new issue, #13489:
URL: https://github.com/apache/iceberg/issues/13489
### Apache Iceberg version
1.7.1
### Query engine
Spark
### Please describe the bug 🐞
Hello,
My team is having an issue when trying to perform a MERGE INTO statement,
when using a dataframe created by reading a JDBC source (temp_view).
MERGE INTO {{ spark_catalog }}.{{ database }}.{{ table }} t
USING (SELECT * FROM temp_view) s
ON ({{ merge_condition|safe}})
{% if push_down_filter != "" %}
AND ({{ push_down_filter|safe}})
{%- endif %}
WHEN NOT MATCHED THEN INSERT *
The error that we are getting is:
_py4j.protocol.Py4JJavaError: An error occurred while calling o373.sql.
: org.apache.spark.SparkException: [INTERNAL_ERROR] Found the unresolved
operator: 'AppendData RelationV2[....] iceberg_catalog.db_name.table_name
iceberg_catalog.db_name.table_name, false
== SQL(line 1, position 1) ==
MERGE INTO iceberg_catalog.db_name.table_name t
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
USING (SELECT * FROM temp_view) s
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ON (s.id1 <=> t.id1 AND s.id2 <=> t.id2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AND (t.field< 200)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
WHEN NOT MATCHED THEN INSERT *
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^_
Also, when we modify the MERGE INTO statement to:
MERGE INTO {{ spark_catalog }}.{{ database }}.{{ table }} t
USING (SELECT * FROM temp_view) s
ON ({{ merge_condition|safe}})
{% if push_down_filter != "" %}
AND ({{ push_down_filter|safe}})
{%- endif %}
WHEN MATCHED THEN UPDATE SET *
WHEN NOT MATCHED THEN INSERT *
the error doesn't occur.
The error also doesn't occur when temp_view comes from a dataframe
originated by reading from a Glue table.
### Willingness to contribute
- [ ] I can contribute a fix for this bug independently
- [ ] I would be willing to contribute a fix for this bug with guidance from
the Iceberg community
- [x] I cannot contribute a fix for this bug at this time
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]