marin-ma commented on code in PR #4952:
URL: https://github.com/apache/incubator-gluten/pull/4952#discussion_r1531602106
##########
backends-velox/src/main/scala/io/glutenproject/execution/GenerateExecTransformer.scala:
##########
@@ -141,92 +108,100 @@ case class GenerateExecTransformer(
getExtensionNodeForValidation
}
}
+}
- // Select child outputs and append generator input.
- private def applyPreProject(
- inputRel: RelNode,
- context: SubstraitContext,
- operatorId: Long
- ): RelNode = {
- val projectExpressions: Seq[ExpressionNode] =
- child.output.indices
- .map(ExpressionBuilder.makeSelection(_)) :+
- ExpressionConverter
- .replaceWithExpressionTransformer(
- generator.asInstanceOf[UnaryExpression].child,
- child.output)
- .doTransform(context.registeredFunction)
+object GenerateExecTransformer {
+ def supportsGenerate(generator: Generator, outer: Boolean): Boolean = {
+ // TODO: supports outer and remove this param.
+ if (outer) {
+ false
+ } else {
+ generator match {
+ case _: Inline | _: ExplodeBase =>
+ true
+ case _ =>
+ false
+ }
+ }
+ }
+}
- RelBuilder.makeProjectRel(
- inputRel,
- projectExpressions.asJava,
- context,
- operatorId,
- child.output.size)
+object PullOutGenerateProjectHelper extends PullOutProjectHelper {
Review Comment:
@liujiayi771 Could you help to review again? I've made some code structure
changes since your last review. This class is created for velox backend to
generate the pre/post projection for GenerateExec. By extending
`PullOutProjectHelper` here, the protected scope of the helper functions can be
preserveed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]