DataQL Quick Query
For fast data inspection and simple queries using DataQL.
Quick Commands
| Task | Command |
|---|---|
| Preview file | dataql run -f <file> -q "SELECT * FROM <table> LIMIT 5" |
| Count rows | dataql run -f <file> -q "SELECT COUNT(*) FROM <table>" |
| Check schema | dataql run -f <file> -q ".schema <table>" |
| List tables | dataql run -f <file> -q ".tables" |
| Distinct values | dataql run -f <file> -q "SELECT DISTINCT <column> FROM <table>" |
| Filter rows | dataql run -f <file> -q "SELECT * FROM <table> WHERE <condition> LIMIT 10" |
File Naming Convention
- •Table name = filename without extension
- •
users.csv-> table name isusers - •
orders.json-> table name isorders - •
data.parquet-> table name isdata
Examples
Preview a CSV file
bash
dataql run -f users.csv -q "SELECT * FROM users LIMIT 5"
Count records
bash
dataql run -f orders.json -q "SELECT COUNT(*) as total FROM orders"
Check structure
bash
dataql run -f data.parquet -q ".schema data"
Simple filter
bash
dataql run -f products.csv -q "SELECT name, price FROM products WHERE price > 100 LIMIT 10"
Read from stdin
bash
cat data.csv | dataql run -f - -q "SELECT * FROM stdin_data LIMIT 5"
Note: When reading from stdin, the default table name is stdin_data.
Supported Formats
- •CSV (with custom delimiter:
-d ";") - •JSON (arrays or objects)
- •JSONL/NDJSON
- •XML
- •YAML
- •Parquet
- •Excel (.xlsx, .xls)
- •Avro
- •ORC
Output Options
- •Default: formatted table
- •JSON output: pipe to
jqor use export - •CSV export:
-e output.csv -t csv - •JSONL export:
-e output.jsonl -t jsonl
Exploratory Statistics
bash
# Get comprehensive statistics for a file dataql describe -f data.csv # Describe specific table after loading dataql run -f data.csv -q ".describe data"
Quick Troubleshooting
| Problem | Solution |
|---|---|
| "column not found" | Check column names with .schema (case sensitive) |
| "table not found" | Table name = filename without extension |
| Too much output | Add LIMIT 10 or LIMIT 5 to query |
| File too large | Use --cache flag to cache imported data |
| Wrong delimiter | Use -d ";" for semicolon-separated files |
Notes
- •Always use LIMIT for large files to avoid overwhelming output
- •Use
.schemafirst to understand column names and types - •For stdin input with non-CSV format:
-i jsonor-i jsonl - •Use
--cachefor repeated queries on the same file - •Use
-Q(quiet) to suppress progress bar in scripts