[ 
https://issues.apache.org/jira/browse/PHOENIX-7407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17955597#comment-17955597
 ] 

ASF GitHub Bot commented on PHOENIX-7407:
-----------------------------------------

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`.





> Remove deprecated datasource V1 code from spark2 and spark3 connector
> ---------------------------------------------------------------------
>
>                 Key: PHOENIX-7407
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-7407
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: rejeb ben rejeb
>            Assignee: rejeb ben rejeb
>            Priority: Major
>
> The pupose of this jira is to remove deprecated datasource V1 code. It is 
> safe to remove these classes since they are used internally by spark and not 
> referenced directly in applications code.
> But in order to not impact old applications, all V1 interfaces (utlity 
> methods and the source type "org.apache.phoenix.spark") will be kept and code 
> will modified to use new connector version classes.
> As dfiscussed on dev mailing list, one acceptable side effect is that spark3 
> SameMode will accept both "Append" and "Overwrite" values. However behavior 
> will be the same.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to