Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/7013#discussion_r33335777
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala ---
@@ -37,6 +37,19 @@ import org.apache.spark.sql.sources.{ResolvedDataSource,
CreateTableUsingAsSelec
final class DataFrameWriter private[sql](df: DataFrame) {
/**
+ * Check if the provided dataframe has multiple columns
+ * before writing it to an external source
+ */
+ private val error : Unit = {
+ if (df.schema.fieldNames.length !=
df.schema.fieldNames.distinct.length) {
--- End diff --
the best place to do this might be looking at a logical plan that contains
an output operator, rather than putting it in the writer itself.
---
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]