rejeb commented on code in PR #145:
URL: 
https://github.com/apache/phoenix-connectors/pull/145#discussion_r2120290282


##########
phoenix5-spark/src/main/scala/org/apache/phoenix/spark/DefaultSource.scala:
##########
@@ -17,44 +17,6 @@
  */
 package org.apache.phoenix.spark
 
-import org.apache.spark.sql.sources.{BaseRelation, CreatableRelationProvider, 
RelationProvider}
-import org.apache.spark.sql.{DataFrame, SQLContext, SaveMode}
+import org.apache.phoenix.spark.datasource.v2.PhoenixDataSource
 
-@deprecated("Use the DataSource V2 API implementation (see PhoenixDataSource)")
-class DefaultSource extends RelationProvider with CreatableRelationProvider {
-
-  // Override 'RelationProvider.createRelation', this enables DataFrame.load()
-  override def createRelation(sqlContext: SQLContext, parameters: Map[String, 
String]): BaseRelation = {
-    verifyParameters(parameters)
-
-    new PhoenixRelation(
-      parameters("table"),
-      parameters("zkUrl"),
-      parameters.contains("dateAsTimestamp")
-    )(sqlContext)
-  }
-
-  // Override 'CreatableRelationProvider.createRelation', this enables 
DataFrame.save()
-  override def createRelation(sqlContext: SQLContext, mode: SaveMode,
-                              parameters: Map[String, String], data: 
DataFrame): BaseRelation = {
-
-    if (!mode.equals(SaveMode.Overwrite)) {

Review Comment:
   The same check is done in spark2 datasource V2 code in this class 
`org.apache.phoenix.spark.datasource.v2.writer.PhoenixDataSourceWriter`.
   IDK if there is a test for this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to