Simple Egress
KINETICA_URL=http://localhost:9191
USERNAME=auser
PASSWORD=apassword
TABLE_NAME=product
# Quote the URL when passing multiple options, or any & will stop the URL
# parsing and run the URL parsed up to that point as a background job
curl -sS ${KINETICA_URL}/get/records/json?table_name=${TABLE_NAME} \
--header "Content-Type: application/json" \
--user "${USERNAME}:${PASSWORD}"
kinetica_url = "http://localhost:9191"
username = "auser"
password = "apassword"
kinetica = gpudb.GPUdb([kinetica_url], username = username, password = password)
table_name = "example.product"
order = None
response = kinetica.get_records_json(table_name, orderby_columns = order)
String url = "http://localhost:9191"
GPUdb.Options options = new GPUdb.Options();
options.setUsername(username);
options.setPassword(password);
GPUdb kdb = new GPUdb(url, options);
String tableName = "product";
GetRecordsJsonResponse response = kdb.getRecordsJson(tableName, null, 0, GPUdb.END_OF_SET);
const kinetica_url = 'http://localhost:9191'
const username = 'auser'
const password = 'apassword'
const db = new GPUdb([kinetica_url], {'username': username, 'password': password});
let tableName = 'product';
let order = [];
db.get_records_json(tableName, [], 0, GPUdb.END_OF_SET, null, order, null, (err, response) => {
if (err)
console.error(err);
else
console.info("All records:");
response.records.forEach(element => {
console.info(element);
});
});
const kinetica_url = 'http://localhost:9191'
const username = 'auser'
const password = 'apassword'
const db = new GPUdb([kinetica_url], {'username': username, 'password': password});
let tableName = 'product';
let order = [];
db.get_records_json(tableName, [], 0, GPUdb.END_OF_SET, null, order, null, (err, response) => {
if (err)
console.error(err);
else
console.info("All records:");
response.records.forEach(element => {
console.info(element);
});
});
Egress with Parameters
KINETICA_URL=http://localhost:9191
USERNAME=auser
PASSWORD=apassword
TABLE_NAME=product
# Using data-urlencode can make params easier to read than appending to URL
# Use the G option to pass the data-urlencode options as GET query parameters
curl -sSG ${KINETICA_URL}/get/records/json \
--header "Content-Type: application/json" \
--user "${USERNAME}:${PASSWORD}" \
--data-urlencode "table_name=${TABLE_NAME}" \
--data-urlencode "column_names=name,category,description,stock" \
--data-urlencode "expression=stock > 100000" \
--data-urlencode "order_by=name"
kinetica_url = "http://localhost:9191"
username = "auser"
password = "apassword"
kinetica = gpudb.GPUdb([kinetica_url], username = username, password = password)
table_name = "example.product"
column_names = ["name", "category", "description", "stock"]
expr = "stock > 100000"
order = ["name"]
response = kinetica.get_records_json(table_name, column_names, expression = expr, orderby_columns = order)
String url = "http://localhost:9191"
GPUdb.Options options = new GPUdb.Options();
options.setUsername(username);
options.setPassword(password);
GPUdb kdb = new GPUdb(url, options);
String tableName = "product";
List<String> columnNames = GPUdb.list("name", "category", "description", "stock");
String expression = "stock > 100000";
List<String> order = GPUdb.list("name");
GetRecordsJsonResponse response =
kdb.getRecordsJson(tableName, columnNames, 0, GPUdb.END_OF_SET, expression, order);
const kinetica_url = 'http://localhost:9191'
const username = 'auser'
const password = 'apassword'
const db = new GPUdb([kinetica_url], {'username': username, 'password': password});
let tableName = 'product';
const columnNames = ['name', 'category', 'description', 'stock'];
const expression = 'stock > 100000';
const order = ['name'];
db.get_records_json(tableName, columnNames, 0, GPUdb.END_OF_SET, expression, order, null, (err, response) => {
if (err)
console.error(err);
else
console.info("Filtered records:");
response.records.forEach(element => {
console.info(element);
});
});
const kinetica_url = 'http://localhost:9191'
const username = 'auser'
const password = 'apassword'
const db = new GPUdb([kinetica_url], {'username': username, 'password': password});
let tableName = 'product';
const columnNames = ['name', 'category', 'description', 'stock'];
const expression = 'stock > 100000';
const order = ['name'];
db.get_records_json(tableName, columnNames, 0, GPUdb.END_OF_SET, expression, order, null, (err, response) => {
if (err)
console.error(err);
else
console.info("Filtered records:");
response.records.forEach(element => {
console.info(element);
});
});
Egress with Aggregation
KINETICA_URL=http://localhost:9191
USERNAME=auser
PASSWORD=apassword
TABLE_NAME=product
# Using data-urlencode can make params easier to read than appending to URL
# Use the G option to pass the data-urlencode options as GET query parameters
curl -sSG ${KINETICA_URL}/get/records/json \
--header "Content-Type: application/json" \
--user "${USERNAME}:${PASSWORD}" \
--data-urlencode "table_name=${TABLE_NAME}" \
--data-urlencode "column_names=category,COUNT(1) AS total_products" \
--data-urlencode "expression=stock >= 1000" \
--data-urlencode "having=COUNT(1) > 1"
kinetica_url = "http://localhost:9191"
username = "auser"
password = "apassword"
kinetica = gpudb.GPUdb([kinetica_url], username = username, password = password)
table_name = "example.product"
column_names = ["category", "COUNT(1) AS total_products"]
expr = "stock >= 1000"
having = "COUNT(1) > 1"
response = kinetica.get_records_json(table_name, column_names, expression = expr, having_clause = having)
String url = "http://localhost:9191"
GPUdb.Options options = new GPUdb.Options();
options.setUsername(username);
options.setPassword(password);
GPUdb kdb = new GPUdb(url, options);
String tableName = "product";
List<String> columnNames = GPUdb.list("category", "COUNT(1) AS total_products");
String expression = "stock > 1000";
String having = "COUNT(1) > 1";
GetRecordsJsonResponse response =
kdb.getRecordsJson(tableName, columnNames, 0, GPUdb.END_OF_SET, expression, having);
const kinetica_url = 'http://localhost:9191'
const username = 'auser'
const password = 'apassword'
const db = new GPUdb([kinetica_url], {'username': username, 'password': password});
let tableName = 'product';
const columnNames = ['category', 'COUNT(1) AS total_products'];
const expression = 'stock >= 1000';
const having = 'COUNT(1) > 1';
const order = [];
db.get_records_json(tableName, columnNames, 0, GPUdb.END_OF_SET, expression, order, having, (err, response) => {
if (err)
console.error(err);
else
console.info("Aggregated records:");
response.records.forEach(element => {
console.info(element);
});
});
const kinetica_url = 'http://localhost:9191'
const username = 'auser'
const password = 'apassword'
const db = new GPUdb([kinetica_url], {'username': username, 'password': password});
let tableName = 'product';
const columnNames = ['category', 'COUNT(1) AS total_products'];
const expression = 'stock >= 1000';
const having = 'COUNT(1) > 1';
const order = [];
db.get_records_json(tableName, columnNames, 0, GPUdb.END_OF_SET, expression, order, having, (err, response) => {
if (err)
console.error(err);
else
console.info("Aggregated records:");
response.records.forEach(element => {
console.info(element);
});
});