Using R, I am trying to read image files using WebHDFS API on Azure DataLakeStore. It is not working.
However, I can read the text files using WebHDFS API sitting next to image file, using same code, with no issues. Also, I can read image files which is openly available on internet.
1. Code to read JPG on DataLakeStore (doesn't work) using WebHDFS API
a <- GET("https://<mydatalakestore>.azuredatalakestore.net/webhdfs/v1/<folder>/pic.jpg?op=OPEN&read=true",
add_headers(Authorization = "Bearer <Auth Token>"))
a$status_code == 403
OR
a <- GET("https://<mydatalakestore>.azuredatalakestore.net/webhdfs/v1/<folder>/pic.jpg",
add_headers(Authorization = "Bearer <Auth token>"))
a$status_code == 400
2. Code to read JPG on Open Web (Works fine)
a <- GET("http://cran.r-project.org/Rlogo.jpg")
a$status_code == 200
x <- content(a)
plot(0:1, 0:1, type = "n")
rasterImage(x, 0, 0, 1, 1)
3. Code to read Text (sitting next to image file on DataLakeStore; works fine) using WebHDFS API
a <- GET("https://<mydatalakestore>.azuredatalakestore.net/webhdfs/v1/<myfolder>/testfile3.txt?op=OPEN&read=true",
add_headers(Authorization = "Bearer <Auth Token>"))
a$status_code == 200