Partition: If our bucket structure is like:
├── S3bucket │ ├── 2018 │ │ ├── 01 │ │ │ ├── 30 │ │ │ │ ├── 22 │ │ │ │ │ ├── file_name
and we want to add partition over folder S3bucket/2018/01/30/22 and your partition key is year, month, day, hour then we can add like:
alter table <table_name> add if not exists partition(year='2018', month='01', day='30', hour='22') location 's3://S3bucket/2018/01/30/22/'