Last active
August 29, 2015 14:24
-
-
Save zdepablo/c241ef9b152cdb244db1 to your computer and use it in GitHub Desktop.
Hive receipts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Overwrite non-partitioned table with their own contents | |
CREATE table xx_COPY LIKE xx; | |
INSERT OVERWRITE TABLE xx | |
SELECT * FROM xx | |
# Overwrite partitioned table with their own contents | |
CREATE table xx_COPY LIKE xx; | |
SHOW PARTITIONS ABC; | |
## for each partition: | |
INSERT OVERWRITE ABC_COPY PARTITION(partkey = "$partkey") | |
SELECT `(partkey)?+.+` FROM ABC WHERE partkey = "$partkey"; | |
# Count rows | |
SELECT COUNT(*) | |
FROM xx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment