Skip to content

[SPARK-38655][SQL] OffsetWindowFunctionFrameBase cannot find the offset row whose input is not-null#35971

Closed
beliefer wants to merge 6 commits intoapache:masterfrom
beliefer:SPARK-38655
Closed

[SPARK-38655][SQL] OffsetWindowFunctionFrameBase cannot find the offset row whose input is not-null#35971
beliefer wants to merge 6 commits intoapache:masterfrom
beliefer:SPARK-38655

Conversation

@beliefer
Copy link
Contributor

What changes were proposed in this pull request?

select x, nth_value(x, 5) IGNORE NULLS over (order by x rows between unbounded preceding and current row)
from (select explode(sequence(1, 3)) x)

The sql output:

null
null
3

But it should returns

null
null
null

Why are the changes needed?

Fix the bug UnboundedPrecedingOffsetWindowFunctionFrame works not good.

Does this PR introduce any user-facing change?

'Yes'.
The output will be correct after fix this bug.

How was this patch tested?

New tests.

… find the offset row whose input is not null
@github-actions github-actions bot added the SQL label Mar 25, 2022
@beliefer beliefer changed the title [SPARK-38655][SQL] UnboundedPrecedingOffsetWindowFunctionFrame cannot find the offset row whose input is not null [SPARK-38655][SQL] OffsetWindowFunctionFrameBase cannot find the offset row whose input is not null Mar 26, 2022
@beliefer beliefer changed the title [SPARK-38655][SQL] OffsetWindowFunctionFrameBase cannot find the offset row whose input is not null [SPARK-38655][SQL] OffsetWindowFunctionFrameBase cannot find the offset row whose input is not-null Mar 26, 2022
@beliefer
Copy link
Contributor Author

ping @cloud-fan

@cloud-fan
Copy link
Contributor

thanks, merging to master/3.3/3.2!

@cloud-fan cloud-fan closed this in 3ffe4ef Mar 28, 2022
@beliefer
Copy link
Contributor Author

@cloud-fan Thanks a lot!

cloud-fan pushed a commit that referenced this pull request Mar 28, 2022
…fset row whose input is not-null

### What changes were proposed in this pull request?
```
select x, nth_value(x, 5) IGNORE NULLS over (order by x rows between unbounded preceding and current row)
from (select explode(sequence(1, 3)) x)
```
The sql output:
```
null
null
3
```
But it should returns
```
null
null
null
```

### Why are the changes needed?
Fix the bug UnboundedPrecedingOffsetWindowFunctionFrame works not good.

### Does this PR introduce _any_ user-facing change?
'Yes'.
The output will be correct after fix this bug.

### How was this patch tested?
New tests.

Closes #35971 from beliefer/SPARK-38655.

Authored-by: Jiaan Geng <beliefer@163.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
cloud-fan pushed a commit that referenced this pull request Mar 28, 2022
…fset row whose input is not-null

### What changes were proposed in this pull request?
```
select x, nth_value(x, 5) IGNORE NULLS over (order by x rows between unbounded preceding and current row)
from (select explode(sequence(1, 3)) x)
```
The sql output:
```
null
null
3
```
But it should returns
```
null
null
null
```

### Why are the changes needed?
Fix the bug UnboundedPrecedingOffsetWindowFunctionFrame works not good.

### Does this PR introduce _any_ user-facing change?
'Yes'.
The output will be correct after fix this bug.

### How was this patch tested?
New tests.

Closes #35971 from beliefer/SPARK-38655.

Authored-by: Jiaan Geng <beliefer@163.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
kazuyukitanimura pushed a commit to kazuyukitanimura/spark that referenced this pull request Aug 10, 2022
…fset row whose input is not-null

### What changes were proposed in this pull request?
```
select x, nth_value(x, 5) IGNORE NULLS over (order by x rows between unbounded preceding and current row)
from (select explode(sequence(1, 3)) x)
```
The sql output:
```
null
null
3
```
But it should returns
```
null
null
null
```

### Why are the changes needed?
Fix the bug UnboundedPrecedingOffsetWindowFunctionFrame works not good.

### Does this PR introduce _any_ user-facing change?
'Yes'.
The output will be correct after fix this bug.

### How was this patch tested?
New tests.

Closes apache#35971 from beliefer/SPARK-38655.

Authored-by: Jiaan Geng <beliefer@163.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants