Skip to content

Conversation

@panbingkun
Copy link
Contributor

@panbingkun panbingkun commented Jul 31, 2024

What changes were proposed in this pull request?

The pr aims to update the explanation for star_clause in the doc sql-ref-syntax-qry-select.md.

Why are the changes needed?

Does this PR introduce any user-facing change?

Yes, only for docs.

How was this patch tested?

Manually test.

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the DOCS label Jul 31, 2024
@panbingkun
Copy link
Contributor Author

Manually check as follows:
image


An expression with an assigned name. In general, it denotes a column expression.

**Syntax:** `expression [[AS] alias]`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have already moved this up.

@panbingkun panbingkun marked this pull request as ready for review July 31, 2024 10:55
@panbingkun panbingkun changed the title [SPARK-49073][SQL][DOCS] Improve docs sql-ref-syntax-qry-select.md [SPARK-49073][SQL][DOCS] Improve the doc sql-ref-syntax-qry-select.md Jul 31, 2024
@panbingkun
Copy link
Contributor Author

cc @stefankandic @HyukjinKwon

@panbingkun
Copy link
Contributor Author

@stefankandic
Copy link
Contributor

I don't see these link for parameters anywhere in the spark docs, so not sure we should just add them for the select page

@panbingkun
Copy link
Contributor Author

panbingkun commented Jul 31, 2024

I understand your concern that it may result in inconsistent document styles.
Perhaps we can apply the above pattern to all parameters of "docs/sql-ref-syntax*.md" files (approximately 89 documents).
I think this clickable parameter can bring convenience to end-users.

(base) ➜  docs git:(master) ✗ find . -name "sql-ref-syntax*.md" | xargs grep "### Parameters" | wc -l
      89

WDYT @HyukjinKwon ?

out repeated subquery blocks in the FROM clause and improves readability of the query.

* **hints**
* **[hints](sql-ref-syntax-qry-select-hints.html)**
Copy link
Member

Choose a reason for hiding this comment

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

If we go ahead with this, we should probably do it for all? I would separate the PR

Copy link
Contributor Author

@panbingkun panbingkun Aug 2, 2024

Choose a reason for hiding this comment

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

Okay,
I will restore the related clickable parameter first in this pr, and I will do it in another separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

While `select_statement` is defined as
```sql
SELECT [ hints , ... ] [ ALL | DISTINCT ] { [ [ named_expression | regex_column_names | star ] [ , ... ] | TRANSFORM (...) ] }
SELECT [ hints , ... ] [ ALL | DISTINCT ] { [ [ named_expression | regex_column_names | star_clause ] [ , ... ] | TRANSFORM (...) ] }
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should do star [ except_clause ] instead of having except_clause inside the star_clause.

Copy link
Contributor Author

@panbingkun panbingkun Aug 8, 2024

Choose a reason for hiding this comment

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

I am referring to this doc https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-qry-select.html, as follows:
image
Based on my understanding, I think one possible reason is that EXCEPT cannot exist independently of STAR, which seems to emphasize this relationship.

@github-actions
Copy link

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Nov 17, 2024
@github-actions github-actions bot closed this Nov 18, 2024
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.

4 participants