Skip to content

Instantly share code, notes, and snippets.

@sqlparser
Created December 12, 2023 08:16
Show Gist options
  • Save sqlparser/0d566672d59d8833a6cc6edfac1d82aa to your computer and use it in GitHub Desktop.
Save sqlparser/0d566672d59d8833a6cc6edfac1d82aa to your computer and use it in GitHub Desktop.
Spark SQL Sample SQL
```sql
-- sparksql sample sql
CREATE TABLE person (id INT, name STRING, age INT, class INT, address STRING);
SELECT * FROM person
PIVOT (
SUM(age) AS a, AVG(class) AS c
FOR name IN ('John' AS john, 'Mike' AS mike)
);
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment