A SQLAlchemy dialect and DBAPI implementation for connecting Apache Superset to Parseable, enabling seamless data visualization and analytics of your log data.
- Full SQLAlchemy dialect implementation for Parseable
- Support for timestamp-based queries
- Automatic schema detection
- Support for special characters in table names (e.g., "ingress-nginx")
- Type mapping from Parseable to SQLAlchemy types
- Connection pooling and management
- Python 3.11.6 or higher
- Apache Superset
- A running Parseable instance
First, create and activate a Python virtual environment:
python3 -m venv venv
source venv/bin/activate # On Linux/Mac
# or
.\venv\Scripts\activate # On Windows
Install Apache Superset and perform initial setup:
# Install Superset
pip install apache-superset
# Configure Superset
export SUPERSET_SECRET_KEY=your-secure-secret-key
export FLASK_APP=superset
# Initialize the database
superset db upgrade
# Create an admin user
superset fab create-admin
# Load initial data
superset init
Install the Parseable connector in development mode:
cd sqlalchemy-parseable
pip install -e .
Start the Superset development server:
superset run -p 8088 --with-threads --reload --debugger
Access Superset at http://localhost:8088
- In the Superset UI, go to Data → Databases → + Database
- Select "Other" as the database type
- Use the following SQLAlchemy URI format:
Example:
parseable://username:password@host:port/table_name
parseable://admin:[email protected]:443/ingress-nginx
The connector supports standard SQL queries with some Parseable-specific features:
-- Basic query with time range
SELECT method, status, COUNT(*) as count
FROM ingress-nginx
WHERE p_timestamp >= '2024-01-01T00:00:00Z'
AND p_timestamp < '2024-01-02T00:00:00Z'
GROUP BY method, status;
-- Status code analysis
SELECT status, COUNT(*) as count
FROM ingress-nginx
WHERE p_timestamp >= '2024-01-01T00:00:00Z'
GROUP BY status;
The connector implements several key components:
ParseableDialect
: SQLAlchemy dialect implementationParseableClient
: HTTP client for Parseable APIParseableConnection
: DBAPI connection implementationParseableCursor
: DBAPI cursor implementation
- Query execution with time range filtering
- Schema inspection
- Column type mapping
- Connection testing
- Table existence checking
- No transaction support (Parseable is append-only)
- No write operations support
- Limited to supported Parseable query operations
-
Connection Errors
- Verify Parseable host and port are correct
- Ensure credentials are valid
- Check if table name exists in Parseable
-
Query Errors
- Verify time range format (should be ISO8601)
- Check if column names exist in schema
- Ensure proper quoting for table names with special characters
Contributions are welcome! Please feel free to submit a Pull Request.