Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. CREATE TABLE xmlload(user_id STRING,
  2. song_id BIGINT, artist_id STRING,
  3. timestamp STRING, start_ts String,
  4. end_ts String, geo_cd String, station_id String
  5. song_end_type String, like int. dislike int)
  6. ROW FORMAT SERDE 'com.ibm.spss.hive.serde2.xml.XmlSerDe'
  7. WITH SERDEPROPERTIES (
  8. "column.xpath.user_id"="/record/user_id/text()",
  9. "column.xpath.seller_rating"="/listing/seller_info/seller_rating/text()",
  10. "column.xpath.bidder_name"="/listing/auction_info/high_bidder/bidder_name/text()",
  11. "column.xpath.location"="/listing/auction_info/location/text()",
  12. "column.xpath.bid_history"="/listing/bid_history/*",
  13. "column.xpath.item_info"="/listing/item_info/*"
  14. )
  15. STORED AS
  16. INPUTFORMAT 'com.ibm.spss.hive.serde2.xml.XmlInputFormat'
  17. OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat'
  18. TBLPROPERTIES (
  19. "xmlinput.start"="<listing>",
  20. "xmlinput.end"="</listing>"
  21. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement