Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Select query returns Null value for json file using SerDe

Select query returns Null value for json file using SerDe

New Contributor

I have added the jar file of cloudera ADD JAR hive-serdes-1.0-SNAPSHOT.

 

sample data

{
    "_id" : "0000540a-e28c-44e3-a2bf-d579af4d43f4",
    "CreatedDate" : ISODate("2014-12-22T18:22:30.250Z"),
    "UpdatedDate" : ISODate("2015-02-12T04:23:53.326Z"),
    "AccountId" : "73f98922-c1a9-4fd9-bcbf-bcb24ea50009",
    "Url" : "https://mail.google.com/mail/u/1/#search/paul+roberts",
    "Host" : "mail.google.com",
    "VisitTime" : ISODate("2014-12-22T17:59:51.225Z"),
    "Transition" : "link",
    "LifeTime" : 3267.0000000000000000,
    "Status" : "closed",
    "LocalTime" : ISODate("2014-12-22T17:59:51.225Z"),
    "referrer" : "",
    "tabId" : "409",
    "SiteType" : "Mail"
}

 

I have create the table : create external table pof.TestForJson( id string, CreatedDate STRUCT, UpdatedDate STRUCT, AccountId string, Url string, Host string, VisitTime STRUCT, Transition string, LifeTime string, Status string, LocalTime STRUCT, DeviceId string, SubSiteType string, SiteType string, Flag string) ROW FORMAT serde 'com.cloudera.hive.serde.JSONSerDe' with serdeproperties("id"="_id" , "CreatedDate.date"="$.date" , "UpdatedDate.date"="$.date" , "VisitTime.date"="$.date" , "LocalTime.date"="$.date") location '/user/hive/warehouse/pof.db/testdata';

 

Please help.