You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2023/02/16 00:30:00 UTC
[jira] [Resolved] (SPARK-42426) insertInto fails when the column names are different from the table columns
[ https://issues.apache.org/jira/browse/SPARK-42426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyukjin Kwon resolved SPARK-42426.
----------------------------------
Fix Version/s: 3.4.0
Resolution: Fixed
Issue resolved by pull request 40024
[https://github.com/apache/spark/pull/40024]
> insertInto fails when the column names are different from the table columns
> ---------------------------------------------------------------------------
>
> Key: SPARK-42426
> URL: https://issues.apache.org/jira/browse/SPARK-42426
> Project: Spark
> Issue Type: Sub-task
> Components: Connect
> Affects Versions: 3.4.0
> Reporter: Takuya Ueshin
> Assignee: Takuya Ueshin
> Priority: Major
> Fix For: 3.4.0
>
>
> {noformat}
> File "/.../python/pyspark/sql/connect/readwriter.py", line 518, in pyspark.sql.connect.readwriter.DataFrameWriter.insertInto
> Failed example:
> df.selectExpr("age AS col1", "name AS col2").write.insertInto("tblA")
> Exception raised:
> Traceback (most recent call last):
> File "/.../lib/python3.9/doctest.py", line 1334, in __run
> exec(compile(example.source, filename, "single",
> File "<doctest pyspark.sql.connect.readwriter.DataFrameWriter.insertInto[3]>", line 1, in <module>
> df.selectExpr("age AS col1", "name AS col2").write.insertInto("tblA")
> File "/.../python/pyspark/sql/connect/readwriter.py", line 477, in insertInto
> self.saveAsTable(tableName)
> File "/.../python/pyspark/sql/connect/readwriter.py", line 495, in saveAsTable
> self._spark.client.execute_command(self._write.command(self._spark.client))
> File "/.../python/pyspark/sql/connect/client.py", line 553, in execute_command
> self._execute(req)
> File "/.../python/pyspark/sql/connect/client.py", line 648, in _execute
> self._handle_error(rpc_error)
> File "/.../python/pyspark/sql/connect/client.py", line 718, in _handle_error
> raise convert_exception(info, status.message) from None
> pyspark.errors.exceptions.connect.AnalysisException: Cannot resolve 'age' given input columns: [col1, col2].
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org