Skip to content

Commit

Permalink
Lateral eval expressions supported after Spark upgrading (opensearch-…
Browse files Browse the repository at this point in the history
…project#544)

Signed-off-by: Lantao Jin <[email protected]>
  • Loading branch information
LantaoJin authored Aug 12, 2024
1 parent def26cf commit c733d3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,7 @@ class FlintSparkPPLEvalITSuite
comparePlans(logicalPlan, expectedPlan, checkAnalysis = false)
}

// +--------------------------------+
// | Below tests are not supported |
// +--------------------------------+
// Todo: Upgrading spark version to 3.4.0 and above could fix this test.
// https://issues.apache.org/jira/browse/SPARK-27561
ignore("test lateral eval expressions references - SPARK-27561 required") {
test("test lateral eval expressions references") {
val frame = sql(s"""
| source = $testTable | eval col1 = 1, col2 = col1 | fields name, age, col2
| """.stripMargin)
Expand Down
2 changes: 1 addition & 1 deletion ppl-spark-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ Assumptions: `a`, `b`, `c` are existing fields in `table`
- `source = table | eval n = now() | eval t = unix_timestamp(a) | fields n,t`
- `source = table | eval f = a | where f > 1 | sort f | fields a,b,c | head 5`
- `source = table | eval f = a * 2 | eval h = f * 2 | fields a,f,h`
- `source = table | eval f = a * 2, h = f * 2 | fields a,f,h` (Spark 3.4.0+ required)
- `source = table | eval f = a * 2, h = f * 2 | fields a,f,h`
- `source = table | eval f = a * 2, h = b | stats avg(f) by h`

Limitation: Overriding existing field is unsupported, following queries throw exceptions with "Reference 'a' is ambiguous"
Expand Down

0 comments on commit c733d3c

Please sign in to comment.