Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/20043#discussion_r171556291
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/ExprValue.scala
---
@@ -70,13 +72,14 @@ case class GlobalValue(val value: String, val javaType:
ExprType) extends ExprVa
override val canDirectAccess: Boolean = true
}
-case object TrueLiteral extends LiteralValue("true", ExprType("boolean",
true))
-case object FalseLiteral extends LiteralValue("false", ExprType("boolean",
true))
+case object TrueLiteral extends LiteralValue("true", ExprType("boolean"))
+case object FalseLiteral extends LiteralValue("false", ExprType("boolean"))
// Represents the java type of an evaluation.
-case class ExprType(val typeName: String, val isPrimitive: Boolean)
+case class ExprType(val typeName: String) {
+ def isPrimitive(ctx: CodegenContext): Boolean =
ctx.isPrimitiveType(typeName)
+}
object ExprType {
- def apply(ctx: CodegenContext, dataType: DataType): ExprType =
ExprType(ctx.javaType(dataType),
- ctx.isPrimitiveType(dataType))
+ def apply(ctx: CodegenContext, dataType: DataType): ExprType =
ExprType(ctx.javaType(dataType))
--- End diff --
I am not sure this is useful. `ctx.javaType(dataType)` can be done by the
caller
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]