xianyinxin commented on a change in pull request #25626: [SPARK-28892][SQL] Add 
UPDATE support for DataSource V2
URL: https://github.com/apache/spark/pull/25626#discussion_r321060623
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
 ##########
 @@ -422,12 +422,30 @@ case class DataSourceStrategy(conf: SQLConf) extends 
Strategy with Logging with
 }
 
 object DataSourceStrategy {
+
+  /**
+   * Tries to translate a Catalyst [[Expression]] into data source 
[[Expression]].
+   *
+   * @return a `Some[catalog.v2.expressions.Expression]` if the input 
[[Expression]]
+   *         is convertible, otherwise a `None`.
+   */
+  protected[sql] def translateExpression(
+      value: Expression): Option[catalog.v2.expressions.Expression] = {
+    // TODO: currently we only support literal. Will add more public 
expression in future.
+    value match {
+      case l: Literal =>
+        Some(catalog.v2.expressions.LiteralValue(l.value, l.dataType))
+      case _ =>
+        None
+    }
+  }
+
   /**
    * The attribute name of predicate could be different than the one in schema 
in case of
    * case insensitive, we should change them to match the one in schema, so we 
do not need to
    * worry about case sensitivity anymore.
    */
-  protected[sql] def normalizeFilters(
+  protected[sql] def normalizeAttrNames(
 
 Review comment:
   Yes. I'll open another pr for the renaming.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to