Pinot DB Schema
Pinot DB Schema
Pinot DB Schema
wikipedia\"}" http://localhost:8099/query/sql
{
"schemaName": "wikipedia_user_bot_counts",
"dimensionFieldSpecs": [
{
"name": "user",
"dataType": "STRING"
},
{
"name": "bot",
"dataType": "STRING" // You can use "BOOLEAN" if "bot" represents Boolean
values
}
],
"metricFieldSpecs": [
{
"name": "record_count",
"dataType": "LONG"
}
]
}
{
"schemaName": "wikipedia_user_bot_counts",
"dimensionFieldSpecs": [
{"name": "user", "dataType": "STRING"},
{"name": "bot", "dataType": "STRING"} // Assuming you want "bot" as STRING
type
],
"metricFieldSpecs": [
{"name": "record_count", "dataType": "LONG"}
]
}
import subprocess
import json
import time
import psycopg2 # Assuming you're using PostgreSQL
import requests
conn = psycopg2.connect(**db_params)
# Function to run the Pinot query and save results to the database
def run_pinot_query_and_save():
try:
# Define the Pinot query in JSON format
pinot_query = {
"sql": "SELECT domain, count(user) AS changes FROM wikipedia GROUP BY
domain ORDER BY changes DESC LIMIT 10"
}