rdblue commented on a change in pull request #24246: [SPARK-24252][SQL] Add
TableCatalog API
URL: https://github.com/apache/spark/pull/24246#discussion_r277032806
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalog/v2/expressions/expressions.scala
##########
@@ -183,17 +149,10 @@ private[sql] final case class LiteralValue[T](value: T,
dataType: DataType) exte
}
private[sql] final case class FieldReference(parts: Seq[String]) extends
NamedReference {
+ import org.apache.spark.sql.catalog.v2.CatalogV2Implicits._
Review comment:
This makes all of the implicit conversions available, but does not apply
them unless it is necessary. For these implicit classes, the only time it is
necessary is when one of the methods, like `quoted` is called. (The compiler
would also implicitly convert when an object is coerced to the implicit type as
well, but there are no methods that require an `IdentifierHelper`.)
It is fine to import unused implicits. The cases where the compiler will use
them are predictable, and they can be used to provide a richer Scala API for
classes that are limited because they are part of the public API.
I'm also wary of using Scala's `implicit`, but the ability to add methods to
existing classes is one of the cases where I find them reliable and useful.
----------------------------------------------------------------
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]