Skip to content

Commit

Permalink
Merge pull request #3733 from marhar/patch-1
Browse files Browse the repository at this point in the history
Update hive_partitioning.md
  • Loading branch information
szarnyasg authored Sep 26, 2024
2 parents 6f79663 + f52b149 commit af8f15d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/data/partitioning/hive_partitioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ COPY (SELECT *, year(timestamp) AS year, month(timestamp) AS month FROM services
TO 'test' (PARTITION_BY (year, month));
```

When reading, the partition columns are read from the directory structure and
can be can be included or excluded depending on the `hive_partitioning` parameter.

```sql
FROM read_parquet('test/*/*/*.parquet', hive_partitioning = true); -- will include year, month partition columns
FROM read_parquet('test/*/*/*.parquet', hive_partitioning = false); -- will not include year, month columns
```

## Hive Partitioning

Hive partitioning is a [partitioning strategy](https://en.wikipedia.org/wiki/Partition_(database)) that is used to split a table into multiple files based on **partition keys**. The files are organized into folders. Within each folder, the **partition key** has a value that is determined by the name of the folder.
Expand Down

0 comments on commit af8f15d

Please sign in to comment.