Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
dilipbiswal committed Jan 23, 2020
1 parent fbd4096 commit 7e40347
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions docs/sql-ref-syntax-qry-select-distribute-by.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sort the data within each partition.

### Syntax
{% highlight sql %}
DISTRIBUTE BY { expression [ , ...] }
DISTRIBUTE BY { expression [ , ... ] }
{% endhighlight %}

### Parameters
Expand All @@ -38,12 +38,14 @@ DISTRIBUTE BY { expression [ , ...] }
### Examples
{% highlight sql %}
CREATE TABLE person (name STRING, age INT);
INSERT INTO person VALUES ('Zen Hui', 25),
('Anil B', 18),
('Shone S', 16),
('Mike A', 25),
('John A', 18),
('Jack N', 16);
INSERT INTO person VALUES
('Zen Hui', 25),
('Anil B', 18),
('Shone S', 16),
('Mike A', 25),
('John A', 18),
('Jack N', 16);

-- Reduce the number of shuffle partitions to 2 to illustrate the behaviour of `DISTRIBUTE BY`.
-- It's easier to see the clustering and sorting behaviour with less number of partitions.
SET spark.sql.shuffle.partitions = 2;
Expand Down

0 comments on commit 7e40347

Please sign in to comment.