Github user chenghao-intel commented on a diff in the pull request:
https://github.com/apache/spark/pull/7418#discussion_r34752387
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateMutableProjection.scala
---
@@ -45,10 +45,32 @@ object GenerateMutableProjection extends
CodeGenerator[Seq[Expression], () => Mu
else
${ctx.setColumn("mutableRow", e.dataType, i,
evaluationCode.primitive)};
"""
- }.mkString("\n")
+ }
+
+ val projectionCodeSegments =
projectionCodes.grouped(50).toSeq.map(_.mkString("\n"))
+
+ val (projectionCode, projectionFuncs) = if
(projectionCodeSegments.length == 1) {
+ (projectionCodeSegments(0), "")
+ } else {
+ val pCode = (0 until projectionCodeSegments.length).map { i =>
+ s"projectSeg$i(_i);"
+ }.mkString("\n")
+
+ val pFuncs = (0 until projectionCodeSegments.length).map { i =>
+ s"""
+ public void projectSeg$i(Object _i) {
--- End diff --
Since the codegen aim to inline the execution, probably we'd better not to
increase the overhead for type casting.
Even, we'd better to put every 50(says) expressions into a single codegen
function?
---
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]