The ML Platform Behind Uber's AI
Michelangelo AI: 우버의 엔드‑투‑엔드 머신러닝 플랫폼
Chargewire는 일반 HTTP로 SQL을 실행하는 오픈 프로토콜입니다
Chargewire is an open protocol for running SQL over plain HTTP. Results, parameters and uploads are Apache Arrow IPC streams; control messages are small JSON documents. No gRPC, no protobuf.
개발 도구C++ · PythonGitHub @gizmodata온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
Chargewire: an open protocol for SQL over HTTP, powered by Apache Arrow
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Chargewire is an open protocol that lets any HTTP client run SQL against a database server
and get Apache Arrow data back: a browser fetch, curl, or
any language's standard HTTP library. No gRPC, no protobuf, no generated code.
application/vnd.apache.arrow.stream), so every Arrow library reads them
directly. Control messages are small JSON documents.POST runs a query and streams its result.# Get a token, open a session, run a query, read the result with pyarrow.
TOKEN=$(curl -s https://db.example.com/chargewire/v1/auth/token \
-H 'Content-Type: application/json' \
-d '{"grant_type":"password","username":"joe","password":"…"}' | jq -r .access_token)
SESSION=$(curl -s https://db.example.com/chargewire/v1/sessions \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{}' | jq -r .session_id)
curl -s https://db.example.com/chargewire/v1/sessions/$SESSION/statements \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-H 'Accept: application/vnd.apache.arrow.stream' \
-d '{"sql":"SELECT 42 AS answer"}' > result.arrows
python -c "import pyarrow.ipc as ipc; print(ipc.open_stream(source='result.arrows').read_all())"
Every server describes itself at GET /chargewire, so a client knows what it may use:
{
"protocol": "chargewire",
"protocol_versions": ["1"],
"server": {"name": "chargewire-duckdb", "version": "2.0.0 (DuckDB v2.0.0)"},
"capabilities": ["prepared_statements", "transactions", "ingest", "partitioned_ingest",
"long_poll", "ipc_compression_zstd", "ipc_compression_lz4_frame",
"result_partitions", "openapi"],
"auth": {"grant_types": ["password"]},
"links": {"openapi": "/chargewire/v1/openapi.json"}
}
and serves the protocol's OpenAPI 3.1 description at
GET /chargewire/v1/openapi.json, for API browsers and client generators.
(Both run against chargewire-duckdb, the reference server in cpp/.)
sequenceDiagram
participant C as Client
participant S as Chargewire server
C->>S: POST /chargewire/v1/auth/token
S-->>C: bearer token
C->>S: POST /chargewire/v1/sessions
S-->>C: session_id
alt short query: one round trip
C->>S: POST …/statements (Accept: Arrow stream)
S-->>C: Arrow IPC stream
else long query: submit, poll, fetch
C->>S: POST …/statements (Prefer: respond-async)
S-->>C: 201 statement document
C->>S: GET …/statements/{id} (long-poll)
S-->>C: succeeded: result partitions
C->>S: GET …/statements/{id}/result?from_batch=N
S-->>C: Arrow IPC stream (resumable)
end
| Spec | |
|---|---|
| 🔎 Discovery, health and capabilities | §3 |
📜 An OpenAPI 3.1 description, served at GET /chargewire/v1/openapi.json | §3.3, openapi.yaml |
| 🔑 Token sign-in (password, token exchange), browser sign-in | §4 |
| 🗂️ Sessions with options, and transactions | §5 |
| ▶️ Statements: streamed or submit/poll/fetch, positional and named bind parameters | §6 |
| ♻️ Retained, resumable results; errors mid-stream; idempotent submission | §6.5–6.7 |
| 🛑 Cancellation (statement and session) and timeouts | §6.8–6.9 |
| 🔀 Partitioned results, read concurrently over several connections, in order or not | §6.10 |
| 🧪 Prepared statements with JSON or Arrow parameter batches | §7 |
| 📥 Streaming bulk ingest | §8 |
🗜️ Arrow buffer compression, lz4_frame or zstd, negotiated by preference | §8.2 |
여기까지가 README 앞부분입니다. 나머지는 원문에서 읽을 수 있습니다. README 전문 보기 ↗
| 📤 Partitioned ingest: one upload over several connections, committed atomically | §8.3 |
| 🔐 Security model: principals, bound handles, governed results | §9 |
| 📚 Metadata with Flight SQL's result schemas, so driver code carries over | §10 |
| ⚠️ Problem-document errors and graceful shutdown | §11 |
| 🧭 Versioning rules | §12 |