hadoop - Twitter Json data not getting queried in Hive -
i trying twitter sentiment analysis using flume, hadoop , hive. following article . able tweets hdfs using flume. twitter-agent configuration.
#setting properties of agent twitter-agent.sources=source1 twitter-agent.channels=channel1 twitter-agent.sinks=sink1 #configuring sources twitter-agent.sources.source1.type=com.cloudera.flume.source.twittersource twitter-agent.sources.source1.channels=channel1 twitter-agent.sources.source1.consumerkey=<consumer-key> twitter-agent.sources.source1.consumersecret=<consumer-secret> twitter-agent.sources.source1.accesstoken=<access-token> twitter-agent.sources.source1.accesstokensecret=<access-token-secret> twitter-agent.sources.source1.keywords= morning, night, hadoop, bigdata #configuring channels twitter-agent.channels.channel1.type=memory twitter-agent.channels.channel1.capacity=10000 twitter-agent.channels.channel1.transactioncapacity=100 #configuring sinks twitter-agent.sinks.sink1.channel=channel1 twitter-agent.sinks.sink1.type=hdfs twitter-agent.sinks.sink1.hdfs.path=flume/tweets twitter-agent.sinks.sink1.rollsize=0 twitter-agent.sinks.sink1.rollcount=10000 twitter-agent.sinks.sink1.batchsize=1000 twitter-agent.sinks.sink1.filetype=datastream twitter-agent.sinks.sink1.writeformat=text
then created table in article , table created. when query table,it gives error
hive> select * tweets; ok failed exception java.io.ioexception:org.apache.hadoop.hive.serde2.serdeexception: org.codehaus.jackson.jsonparseexception: unexpected character ('s' (code 83)): expected valid value (number, string, array, object, 'true', 'false' or 'null') @ [source: java.io.stringreader@31228d83; line: 1, column: 2] time taken: 0.914 seconds
i tried other queries select count(id) tweets
shows lot of errors.
this 1 of flumedata file(tweets) present in hdfs.
seq!org.apache.hadoop.io.longwritable"org.apache.hadoop.io.byteswritable;�@z_�>��<���n ����{"in_reply_to_status_id_str":"613363183034601472","in_reply_to_status_id":613363183034601472,"created_at":"tue jun 23 15:09:32 +0000 2015","in_reply_to_user_id_str":"604605328","source":"<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">twitter iphone<\/a>","retweet_count":0,"retweeted":false,"geo":null,"filter_level":"low","in_reply_to_screen_name":"alexiblue","id_str":"613363262760034304","in_reply_to_user_id":604605328,"favorite_count":0,"id":613363262760034304,"text":"@alexiblue morning ☺️","place":null,"lang":"en","favorited":false,"possibly_sensitive":false,"coordinates":null,"truncated":false,"timestamp_ms":"1435072172237","entities":{"urls":[],"hashtags":[],"user_mentions":[{"indices":[0,10],"screen_name":"alexiblue","id_str":"604605328","name":"alexi blue ★","id":604605328}],"trends":[],"symbols":[]},"contributors":null,"user":{"utc_offset":null,"friends_count":1175,"profile_image_url_https":"https://pbs.twimg.com/profile_images/604664190763212800/nmqxn_p5_normal.jpg","listed_count":6,"profile_background_image_url":"http://abs.twimg.com/images/themes/theme1/bg.png","default_profile_image":false,"favourites_count":31695,"description":"pizza & tacos life. #flippinfamily #rudunation #abnation #5quad #7squad #samcollinsisbaeaf","created_at":"sun mar 09 02:40:15 +0000 2014","is_translator":false,"profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme1/bg.png","protected":false,"screen_name":"sonja_campbell1","id_str":"2379671544","profile_link_color":"3b94d9","id":2379671544,"geo_enabled":true,"profile_background_color":"c0deed","lang":"en","profile_sidebar_border_color":"c0deed","profile_text_color":"333333","verified":false,"profile_image_url":"http://pbs.twimg.com/profile_images/604664190763212800/nmqxn_p5_normal.jpg","time_zone":null,"url":null,"contributors_enabled":false,"profile_background_tile":false,"profile_banner_url":"https://pbs.twimg.com/profile_banners/2379671544/1434956813","statuses_count":17254,"follow_request_sent":null,"followers_count":871,"profile_use_background_image":true,"default_profile":false,"following":null,"name":"sonita✨","location":"","profile_sidebar_fill_color":"ddeef6","notifications":null}}
can me this?
serde short serializer/deserializer. hive uses serde interface io. , json 1 format supported among many. can see serde exception , json in error message. marshalling , unmarshalling of json data present in hive table column. identify column adding json data. happy coding
Comments
Post a Comment