Skip to content

Instantly share code, notes, and snippets.

SELECT * FROM search_logs WHERE keyword = 'rockset' AND locale = 'en'
SELECT *
FROM search_logs
WHERE keyword = ‘rockset’
AND locale = ‘en’
SELECT keyword, count(*) c
FROM search_logs
GROUP BY keyword
ORDER BY c DESC
git clone git@github.com:rockset/recipes.git
cd recipes/kafka-rockset-integration/
python3 -m virtualenv rockset-kafka-demo
source rockset-kafka-demo/bin/activate
pip install -r requirements.txt
# Kafka Configuration
KAFKA_TOPIC = 'orders'
KAFKA_BOOTSTRAP_SERVER = ['localhost:9092']
# Rockset Configuration
ROCKSET_API_KEY = '' # Create API Key - https://console.rockset.com/manage/apikeys
ROCKSET_API_SERVER = 'https://api.rs2.usw2.rockset.com'
rock configure --api_key <YOUR-API-KEY>
{
"InvoiceNo": 14,
"InvoiceDate": 1547523082,
"CustomerID": 10140,
"Country": "India",
"StockCode": 3009,
"Description": "HAND WARMER RED POLKA DOT",
"Quantity": 6,
"UnitPrice": 1.85
}
SELECT Description, SUM(Quantity) as QuantitiesSold
FROM "orders"
GROUP BY Description
ORDER By QuantitiesSold DESC
LIMIT 5;
SELECT *
FROM orders
LIMIT 10;