Skip to content

Conversation

@zhengruifeng
Copy link
Contributor

What changes were proposed in this pull request?

Make DataFrame.select support a.*

Why are the changes needed?

bugfix:

Traceback (most recent call last):
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/tests/connect/test_connect_basic.py", line 1377, in test_select_star
    cdf.select("a", "b.*").collect(),
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/connect/dataframe.py", line 1305, in collect
    table = self._session.client.to_table(query)
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/connect/client.py", line 445, in to_table
    table, _ = self._execute_and_fetch(req)
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/connect/client.py", line 639, in _execute_and_fetch
    self._handle_error(rpc_error)
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/connect/client.py", line 675, in _handle_error
    raise SparkConnectAnalysisException(
pyspark.errors.exceptions.SparkConnectAnalysisException: [FIELD_NOT_FOUND] No such struct field `*` in `c`, `d`.

Does this PR introduce any user-facing change?

yes

How was this patch tested?

added ut

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

zhengruifeng added a commit that referenced this pull request Feb 8, 2023
### What changes were proposed in this pull request?
Make `DataFrame.select` support `a.*`

### Why are the changes needed?
bugfix:
```
Traceback (most recent call last):
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/tests/connect/test_connect_basic.py", line 1377, in test_select_star
    cdf.select("a", "b.*").collect(),
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/connect/dataframe.py", line 1305, in collect
    table = self._session.client.to_table(query)
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/connect/client.py", line 445, in to_table
    table, _ = self._execute_and_fetch(req)
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/connect/client.py", line 639, in _execute_and_fetch
    self._handle_error(rpc_error)
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/connect/client.py", line 675, in _handle_error
    raise SparkConnectAnalysisException(
pyspark.errors.exceptions.SparkConnectAnalysisException: [FIELD_NOT_FOUND] No such struct field `*` in `c`, `d`.
```

### Does this PR introduce _any_ user-facing change?
yes

### How was this patch tested?
added ut

Closes #39934 from zhengruifeng/connect_select_star.

Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
(cherry picked from commit dbc4c62)
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
@zhengruifeng
Copy link
Contributor Author

merged into master and branch-3.4, thanks

@zhengruifeng zhengruifeng deleted the connect_select_star branch February 8, 2023 06:44
snmvaughan pushed a commit to snmvaughan/spark that referenced this pull request Jun 20, 2023
### What changes were proposed in this pull request?
Make `DataFrame.select` support `a.*`

### Why are the changes needed?
bugfix:
```
Traceback (most recent call last):
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/tests/connect/test_connect_basic.py", line 1377, in test_select_star
    cdf.select("a", "b.*").collect(),
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/connect/dataframe.py", line 1305, in collect
    table = self._session.client.to_table(query)
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/connect/client.py", line 445, in to_table
    table, _ = self._execute_and_fetch(req)
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/connect/client.py", line 639, in _execute_and_fetch
    self._handle_error(rpc_error)
  File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/connect/client.py", line 675, in _handle_error
    raise SparkConnectAnalysisException(
pyspark.errors.exceptions.SparkConnectAnalysisException: [FIELD_NOT_FOUND] No such struct field `*` in `c`, `d`.
```

### Does this PR introduce _any_ user-facing change?
yes

### How was this patch tested?
added ut

Closes apache#39934 from zhengruifeng/connect_select_star.

Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
(cherry picked from commit dbc4c62)
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants