Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/13013#discussion_r62740666
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala ---
@@ -351,6 +351,9 @@ final class DataFrameWriter private[sql](df: DataFrame)
{
* Inserts the content of the [[DataFrame]] to the specified table. It
requires that
* the schema of the [[DataFrame]] is the same as the schema of the
table.
*
+ * Note: Unlike `saveAsTable`, `insertInto` ignores the column names. If
the column order or names
+ * doesn't match the table's, you may get unexpected results.
--- End diff --
How about we explicitly say that we use position-based resolution?
For example, if we have a table `t1` with columns `c: int, d: int`,
`df.select("a", "b").insertInto("t1")` will insert `a`'s data to column `c` and
`b`'s data to column `d`?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]