Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/4373#discussion_r24142085
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/sources/interfaces.scala ---
@@ -158,6 +158,21 @@ trait CatalystScan extends BaseRelation {
}
@DeveloperApi
+/**
+ * ::DeveloperApi::
+ * A BaseRelation that can be used to insert data into it through the
insert method.
+ * If overwrite in insert method is true, the old data in the relation
should be overwritten with
+ * the new data. If overwrite in insert method is false, the new data
should be appended.
+ *
+ * InsertableRelation has the following three assumptions.
+ * 1. It assumes that the data (Rows in the DataFrame) provided to the
insert method
+ * exactly matches the ordinal of fields in the schema of the BaseRelation.
+ * 2. It assumes that the schema of this relation will not be changed.
+ * Even if the insert method updates the schema, the new schema cannot be
used.
--- End diff --
Would be good to mention the schema evolving cases in JSON and Parquet
here. I guess it's not super intuitive for most people because stable schema is
a basic assumption for traditional RDBMS.
---
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]