Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary ProjectExec generated for Generate function #5757

Closed
xumingming opened this issue May 16, 2024 · 0 comments · Fixed by #5782
Closed

Unnecessary ProjectExec generated for Generate function #5757

xumingming opened this issue May 16, 2024 · 0 comments · Fixed by #5782
Labels
enhancement New feature or request

Comments

@xumingming
Copy link
Contributor

Description

For the following test case:

  test("test explode1") {
    withTempView("t1") {
      sql(
        """select * from values (array(1)), (array(2)), (array(3)), (array(4))
          |as tbl(a)
     """.stripMargin).createOrReplaceTempView("t1")
      runQueryAndCompare(
        s"""
           |SELECT explode(a) from t1;
           |""".stripMargin) {
        checkGlutenOperatorMatch[GenerateExecTransformer]
      }
    }
  }

The input of explode is already an Attribute, while current implementation would still plug in a new ProjectExec, which seems not necessary?

Generate explode(a#122), false, [col#128]
+- Project [a#122, a#122]
   +- RewrittenNodeWall Filter (size(a#122, true) > 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant