dchvn opened a new pull request #34737:
URL: https://github.com/apache/spark/pull/34737
### What changes were proposed in this pull request?
Skip check monotonic increasing for Series.asof with 'compute.eager_check'
### Why are the changes needed?
monotonic increasing checking is expensive, so we should use config
'compute.eager_check' to skip this one
### Does this PR introduce _any_ user-facing change?
Yes
Before this PR
```python
>>> s = ps.Series([1, 2, np.nan, 4], index=[10, 30, 20, 40])
>>> with ps.option_context("compute.eager_check", False):
... s.asof(20)
...
21/11/29 17:09:39 WARN WindowExec: No Partition Defined for Window
operation! Moving all data to a single partition, this can cause serious
performance degradation.
21/11/29 17:09:40 WARN WindowExec: No Partition Defined for Window
operation! Moving all data to a single partition, this can cause serious
performance degradation.
21/11/29 17:09:40 WARN WindowExec: No Partition Defined for Window
operation! Moving all data to a single partition, this can cause serious
performance degradation.
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/u02/spark/python/pyspark/pandas/series.py", line 5220, in asof
raise ValueError("asof requires a sorted index")
ValueError: asof requires a sorted index
```
After this PR, when config 'compute.eager_check' is False, pandas-on-Spark
just proceeds and performs by ignoring the indeces's order
```python
>>> s = ps.Series([1, 2, np.nan, 4], index=[10, 30, 20, 40])
>>> with ps.option_context("compute.eager_check", False):
... s.asof(20)
...
1.0
```
### How was this patch tested?
Unit tests
--
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]