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

Add * EXCEPT to the docs #107

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/modules/ROOT/partials/base/table-expressions/select.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@ SELECT * FROM satellites
SELECT Users, Apogee_km, Perigee_km FROM satellites
----
====

.Exclude a subset of a table's columns
[example]
====
[source,gensql]
----
SELECT * EXCEPT Contractor, Country_of_Operator FROM satellites
----
====
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
=== `+GIVEN+`

.Compute the probability of the satellite's period from the model, given the class of orbit.
[example]
====
[source,gensql]
----
SELECT
PROBABILITY OF Period_minutes
UNDER satellites_model GIVEN Class_of_Orbit
UNDER satellites_model
GIVEN Class_of_Orbit
FROM satellites
----
====

.Compute the probability of the satellite's period from the model, given everything but the period, contractor, and operator's country.
[example]
====
[source,gensql]
----
SELECT
PROBABILITY OF Period_minutes
UNDER satellites_model
GIVEN * EXCEPT Period_minutes, Contractor, Country_of_Operator
FROM satellites
----
====
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The `+GENERATE+` expression evaluates to a table of samples from a model.

WARNING: The tables returned by `+GENERATE+` are infinite. A query comprised of a generate expression will run forever. In order to view the output if a `+GENERATE+` expression you should limit its output by wrapping it with a <<select expression,Select>> that includes a `+LIMIT+` clause.

.Generate 10 rows of 3 columns from the model
[example]
====
[source,gensql]
Expand All @@ -18,3 +19,19 @@ FROM
LIMIT 10
----
====

.Generate 10 rows containing almost all columns from the model, but excluding 2
[example]
====
[source,gensql]
----
SELECT *
FROM
GENERATE *
EXCEPT
Contractor,
Country_of_Operator
UNDER model
LIMIT 10
----
====
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
=== `+CONDITIONED BY+`

.Compute the probability density of a model variable after conditioning on another variable
[example]
====
[source,gensql]
Expand All @@ -10,3 +11,16 @@ SELECT
FROM satellites_model
----
====


.Compute the probability density of a model variable after conditioning on all other variables except one
[example]
====
[source,gensql]
----
SELECT
PROBABILITY DENSITY OF VAR Apogee_km < 1000
UNDER model CONDITIONED BY * EXCEPT VAR Apogee_km, VAR Country
FROM satellites_model
----
====
17 changes: 17 additions & 0 deletions docs/modules/ROOT/partials/strict/table-expressions/generate.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The `+GENERATE+` expression evaluates to a table of samples from a model.

WARNING: The tables returned by `+GENERATE+` are infinite. A query comprised of a generate expression will run forever. In order to view the output if a `+GENERATE+` expression you should limit its output by wrapping it with a <<select expression,Select>> that includes a `+LIMIT+` clause.

.Generate 10 rows of three columns from the model
[example]
====
[source,gensql]
Expand All @@ -18,3 +19,19 @@ FROM
LIMIT 10
----
====

.Generate 10 rows containing almost all columns from the model, but excluding 2
[example]
====
[source,gensql]
----
SELECT *
FROM
GENERATE *
EXCEPT
VAR Contractor,
VAR Country_of_Operator
UNDER model
LIMIT 10
----
====
Loading