File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 18
18
package org .apache .spark .sql .catalyst .expressions
19
19
20
20
import org .apache .commons .codec .digest .DigestUtils
21
+ import org .apache .spark .sql .catalyst .expressions .codegen ._
21
22
import org .apache .spark .sql .types .{BinaryType , StringType , DataType }
22
23
import org .apache .spark .unsafe .types .UTF8String
23
24
@@ -41,5 +42,9 @@ case class Md5(child: Expression)
41
42
}
42
43
}
43
44
44
- override def toString : String = s " MD5( $child) "
45
+ override def genCode (ctx : CodeGenContext , ev : GeneratedExpressionCode ): String = {
46
+ defineCodeGen(ctx, ev, c =>
47
+ s """ org.apache.spark.unsafe.types.UTF8String.fromString
48
+ |(org.apache.commons.codec.digest.DigestUtils.md5Hex( $c)) """ .stripMargin)
49
+ }
45
50
}
You can’t perform that action at this time.
0 commit comments