I want to get from my json records that containt always the same PartnerId and Name from users array. I'm currently trying with this code:
@jsonFile =
EXTRACT partnerId int,
users string
FROM @INPUT_FILE
USING new Microsoft.Analytics.Samples.Formats.Json.JsonExtractor();
@followingUsersArray =
SELECT partnerId,
Microsoft.Analytics.Samples.Formats.Json.JsonFunctions.JsonTuple(users) AS following_array
FROM @jsonFile;
@followingUsers =
SELECT partnerId AS PartnerId,
following_array["name"] AS FriendName
FROM @followingUsersArray;
But i'm not get any result. Here's my json example file:
{
"partnerId": 2,
"users": [{
"name": "Anna ROGOWSKA",
"profile_image_url": "http://pbs.twimg.com/profile_images/884844399338901504/0OYl8JA6_normal.jpg",
"created_at": "2012-09-30T19:52:15+02:00",
"location": "Sopot,Poland",
"id_str": "855093368"
},
{
"name": "Anna BARAŃSKA",
"profile_image_url": "http://pbs.twimg.com/profile_images/884844399338901504/0OYl8JA6_normal.jpg",
"created_at": "2012-09-30T19:52:15+02:00",
"location": "Sopot,Poland",
"id_str": "855093368"
}
]
}
The result what i want is : 2,"Anna ROGOWSKA" 2,"Anna BARAŃSKA"