Arrow Flight SQL
Hostname | Port |
|---|---|
flight.altertable.ai | 443 (TLS/SSL) |
Arrow Flight SQL provides the highest-performance interface for streaming large analytical datasets between Altertable and your tools. Built on Apache Arrow's columnar format, it's ideal for:
- Analytics tools like dbt, Airbyte, and custom data pipelines
- Large result sets that benefit from efficient columnar data transfer
- High-throughput workloads requiring minimal serialization overhead
Authentication
Use your Altertable credentials with any Arrow Flight SQL client:
- Username: Your Altertable username
- Password: Your Altertable password
Quick Start
# Altertable exposes a native Arrow Flight SQL endpoint.# Connect any Arrow Flight SQL-compatible client — no extra setup needed.# Python (altertable-flightsql-python)from altertable_flightsql import Client# Connect to flight.altertable.ai:443 w/ TLS/SSLwith Client(username="your_username", password="your_password") as client:# Execute a queryreader = client.query("SELECT * FROM users WHERE age > 18")# Process resultsfor batch in reader:df = batch.data.to_pandas()print(df)
Python Client
Altertable provides an official Python client library (altertable-flightsql) that handles authentication, connection management, queries, prepared statements, transactions, and metadata operations.
Installation
pip install altertable-flightsql
Prepared Statements
Prepare a statement once and execute it multiple times with different parameters:
with client.prepare("SELECT * FROM users WHERE id = $id") as stmt:result = stmt.query(parameters={"id": 1})for batch in result:print(batch.data.to_pandas())
Transactions
Execute multiple statements atomically:
with client.begin_transaction():client.execute("INSERT INTO users ...")client.execute("UPDATE accounts ...")
Metadata Queries
Discover catalogs, schemas, and tables:
catalogs = client.get_catalogs()schemas = client.get_schemas(catalog="my_db")tables = client.get_tables(catalog="my_db", schema_pattern="public")
For more details, examples, and advanced usage, see the GitHub repository.
Other Clients
Any Arrow Flight SQL-compatible client can connect to flight.altertable.ai:443 with TLS.
Python ADBC
import adbc_driver_flightsql.dbapi as flight_sqlconn = flight_sql.connect(uri="grpc+tls://flight.altertable.ai:443",db_kwargs={"username": "your_username","password": "your_password"})cursor = conn.cursor()cursor.execute("SELECT * FROM your_database.your_schema.your_table LIMIT 10")results = cursor.fetchall()