Skip to content

Commit

Permalink
[CARBONDATA-3039] Fix Custom Deterministic Expression for rand() UDF
Browse files Browse the repository at this point in the history
  • Loading branch information
Indhumathi27 committed Oct 24, 2018
1 parent b21a6d4 commit 69c7025
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -26,15 +26,17 @@ import org.apache.spark.sql.types.{DataType, StringType}
* Custom expression to override the deterministic property .
*/
case class CustomDeterministicExpression(nonDt: Expression ) extends Expression with Serializable{
override def nullable: Boolean = true
override def nullable: Boolean = nonDt.nullable

override def eval(input: InternalRow): Any = null
override def eval(input: InternalRow): Any = nonDt.eval(input)

override def dataType: DataType = StringType
override def dataType: DataType = nonDt.dataType

override def children: Seq[Expression] = Seq()
override def children: Seq[Expression] = nonDt.children

def childexp : Expression = nonDt
def childexp: Expression = nonDt

override def genCode(ctx: CodegenContext): ExprCode = nonDt.genCode(ctx)

override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = ev.copy("")
}

0 comments on commit 69c7025

Please sign in to comment.