Created
October 31, 2018 05:17
-
-
Save tangyl/5a2b05fad97be06e3888d94f041ca397 to your computer and use it in GitHub Desktop.
create hive external table with schema from json
This file contains hidden or 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
create external table if not exists {{table_name}}( | |
url string, | |
title string, | |
duration int, | |
play_count int, | |
created_time bigint, | |
last_crawl_time bigint | |
) | |
ROW FORMAT SERDE | |
'org.openx.data.jsonserde.JsonSerDe' | |
STORED AS INPUTFORMAT | |
'org.apache.hadoop.mapred.TextInputFormat' | |
OUTPUTFORMAT | |
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' | |
location "{{hdfs_or_s3_location}}"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment