Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/6716#discussion_r32037994
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/math.scala
---
@@ -21,8 +21,37 @@ import
org.apache.spark.sql.catalyst.expressions.codegen._
import org.apache.spark.sql.types.{DataType, DoubleType}
/**
+ * A leaf expression specifically for math constants. Math constants
expect no input.
+ * @param c The math constant.
+ * @param name The short name of the function
+ */
+abstract class LeafMathExpression(c: Double, name: String)
+ extends LeafExpression with Serializable {
+ self: Product =>
+
+ override def dataType: DataType = DoubleType
+ override def foldable: Boolean = true
+ override def nullable: Boolean = false
+ override def toString: String = s"$name()"
+
+ override def eval(input: Row): Any = c
+
+ // name of constant in java.lang.Math
+ def constName: String = name
--- End diff --
since we don't use this right now, let's remove this extra method and just
use name.
---
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]