Expose a dataset through an API endpoint
Expose your dataset
You can expose a dataset of a Hive or Impala table thanks to a GraphQL API using HTTP basic authentication.
To do so, use the API tab on the dataset details window :
Click on Dataset exposed :
Enter the endpoint of your choice (alphanumerical words, dash separated) and click on the Enable button :
Now, your dataset is available at an URL address.
Request your dataset
You can use this Graph QL endpoint with the `getAll` function allowing you to access all the dataset entries.
This function allows you to select the columns names you want to get.
GraphQL does not support column name with a dot
e.g.:
{
getAll {
first_column_name,
second_column_name,
nth_column_name
}
}
Usage:
[url]/?query={getAll{first_column_name,second_column_name,nth_column_name}}
Filter your dataset
Available from Saagie Platform 2.0 beta and is subject to authorization, see Saagie Data Fabric 2.0 beta
You can filter data with the `get` function allowing you create a 'contains' filter on String column.
Usage:
[url]/?query={get(filter:[{field:first_column_name_to_filter,operator:contains,value:"value"},{field:second_column_name,operator:contains,value:"another_value"}]){first_column_name,second_column_name,nth_column_name}}
Usage with curl:
curl -X GET -u 'login:pass' "[url]?query=%7BgetAll%7Bfirst_column_name,second_column_name,nth_column_name%7D%7D" -vk
special characters { and } must be URL encoded.
{ become %7B
} become %7D