Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/10750#discussion_r49680909
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
---
@@ -480,10 +480,120 @@ private[sql] object DataSourceStrategy extends
Strategy with Logging {
case expressions.Contains(a: Attribute, Literal(v: UTF8String,
StringType)) =>
Some(sources.StringContains(a.name, v.toString))
+ case expressions.BinaryComparison(BinaryArithmetic(left, right),
Literal(v, t)) =>
+ translateArithemiticOPFilter (predicate)
+ case expressions.BinaryComparison(Literal(v, t),
BinaryArithmetic(left, right)) =>
+ translateArithemiticOPFilter (predicate)
+
case _ => None
}
}
+ private def translateArithemiticOPFilter(predicate: Expression):
Option[Filter] = {
+ predicate match {
+ case expressions.EqualTo(Add(left, right), Literal(v, t)) =>
+ Some(sources.ArithmeticOPEqualTo(Add(left, right),
convertToScala(v, t)))
--- End diff --
I took a look of SPARK-10195. Looks like it deals with the issue of
exposing internal data types. It uses `convertToScala` to convert these
internal data types to scala version. Since here `convertToScala` is used to
convert the values. I think it should not be the same problem.
---
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]