1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! The read surface a serving endpoint needs, and nothing else.
//!
//! Two methods, because two is what serving needs: plan a statement without
//! running it, and run it as a stream. [`MeterStore`](super::MeterStore) and
//! [`MeterCatalog`](super::MeterCatalog) both implement it, so
//! [`FlightSqlServer`](crate::serve::FlightSqlServer) serves one table or every
//! table without knowing which it has.
//!
//! That matters because §15.3's ordinary deployment holds authoritative readings
//! *beside* a non-authoritative second stream, and the statement a BI tool wants
//! is frequently the one that mentions both — which only a catalog can express.
//!
//! # Deliberately not `query`
//!
//! Collecting a result is the wrong default for a surface an outsider can point
//! at: peak memory becomes the size of whatever a client asked for, on a socket
//! the client controls. The in-process caller who wants a `Vec<RecordBatch>` has
//! [`MeterStore::query`](super::MeterStore::query) and
//! [`MeterCatalog::query`](super::MeterCatalog::query) directly.
use async_trait;
use SendableRecordBatchStream;
use ScalarValue;
use crateResult;
use QueryDescription;
/// Something that answers SQL and says what it answered against.
///
/// Implemented by [`MeterStore`](super::MeterStore) — one table — and
/// [`MeterCatalog`](super::MeterCatalog) — several, sharing one session.