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
Fix Custom Deterministic Expression for rand() UDF

This closes #2845
  • Loading branch information
Indhumathi27 authored and ravipesala committed Nov 21, 2018
1 parent 30863a4 commit 2e1af7f
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
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 2e1af7f

Please sign in to comment.