Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: support arbitrary functions in FROM clauses #22314

Merged
merged 3 commits into from
Feb 2, 2018

Conversation

knz
Copy link
Contributor

@knz knz commented Feb 1, 2018

Fixes #22312.

The following is valid in pg's SQL dialect:

> SELECT * FROM cos(123)

i.e. any scalar function is a valid data source.

This patch implements this in CockroachDB for compatibility.
This is needed e.g. by TypeORM.

Release note (sql change): scalar functions can now be used
in FROM clauses.

@knz knz requested review from justinj and a team February 1, 2018 22:47
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@knz knz requested a review from a team February 1, 2018 23:01
@jordanlewis
Copy link
Member

:lgtm: does the last commit need a release note?


Reviewed 2 of 2 files at r1.
Review status: 2 of 6 files reviewed at latest revision, all discussions resolved, some commit checks pending.


Comments from Reviewable

@knz
Copy link
Contributor Author

knz commented Feb 2, 2018

The last commit doesn't need a release note because it does the same as the 2nd one, and there wasn't a release in-between the two that would cause users to notice a difference.

TFYR!


Review status: 2 of 6 files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

the ValuesClause is not really needed after planning. Remove it.

Release note: none
The following is valid in pg's SQL dialect:

```
> SELECT * FROM cos(123)
```

i.e. any scalar function is a valid data source.

This patch implements this in CockroachDB for compatibility.
This is needed e.g. by TypeORM.

Release note (sql change): scalar functions can now be used
in FROM clauses.
@knz
Copy link
Contributor Author

knz commented Feb 2, 2018

cc @rytaft for semantic coverage in the opt builder

@knz knz merged commit b67fe33 into cockroachdb:master Feb 2, 2018
@knz knz deleted the 20180201-values branch February 2, 2018 03:39
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.

3 participants