hive query with field is json

if field is json,when query one key from json ,it will help you .

 select  idfa, appid ,appname , countrycode ,  get_json_object( field, '$.carrier'  )    from   impression_hour  where   yr = $yr and mt = $mt and  dt=$dt and  countrycode = 'SG'";

refer :

https://docs.microsoft.com/zh-cn/azure/hdinsight/hdinsight-using-json-in-hive

原文地址:https://www.cnblogs.com/lavin/p/7597511.html