[ https://issues.apache.org/jira/browse/SPARK-42426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17688763#comment-17688763 ]
Apache Spark commented on SPARK-42426: -------------------------------------- User 'ueshin' has created a pull request for this issue: 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 > Priority: Major > > {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-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org