Expand description
Schema inference for the relational (external table) engine: connects to a
remote MySQL database and maps its column types to GreptimeDB
ConcreteDataTypes at CREATE EXTERNAL TABLE time.
Types that cannot be mapped faithfully (e.g. BIT, spatial types, a
DECIMAL wider than 38 digits, or TIME) are rejected rather than
silently degraded. A few types map with documented caveats โ DATETIME
and TIMESTAMP lose their timezone semantics (see map_timestamp).
Structsยง
- MySql
Column - A remote column read from
INFORMATION_SCHEMA.COLUMNS, before its type is mapped to a GreptimeDBConcreteDataType. - MySql
Column Type - A MySQL column type as reported by
INFORMATION_SCHEMA.COLUMNS. - Relational
Column - A remote column already mapped to a GreptimeDB
ConcreteDataType.
Constantsยง
- CONNECT_
TIMEOUT ๐ - Connect + handshake timeout for
CREATE EXTERNAL TABLE; a silently dropping host would otherwise hang the DDL until the OS timeout. - QUERY_
TIMEOUT ๐
Functionsยง
- box_
foreign_ ๐error - Boxes a foreign driver error into a [
BoxedError]. The message is scrubbed: if the driver echoes the connection DSN (which carries the password), it is replaced by its redacted form so credentials never leak. - box_
timeout_ ๐error - build_
mysql_ ๐opts - Parses the connection DSN and, for TCP connections, resolves the host to
candidate IP addresses. When an explicit Unix socket is configured
(
?socket=/path), mysql_async dials the socket path directly, so the host is a placeholder and DNS resolution is skipped entirely. - fetch_
mysql_ columns - Connects to the remote MySQL instance and reads the column list of
remote_tablefromINFORMATION_SCHEMA.COLUMNS. Each column keeps its driver-reported type, so callers decide which columns to map to a GreptimeDBConcreteDataType. - map_
decimal ๐ - map_
mysql_ column_ type - Maps a MySQL column type to a GreptimeDB
ConcreteDataType. - map_
mysql_ columns - Maps raw MySQL columns to GreptimeDB
ConcreteDataTypes viamap_mysql_column_type. - map_
timestamp ๐ - parse_
host_ ๐literal - Parses
hostas a literal IP address, stripping the URL-level brackets that wrap an IPv6 literal (e.g.[::1]โ::1). ReturnsNonewhenhostis a hostname rather than a literal. - resolve_
host_ ๐ips - Resolves
hostto the full list of IP addresses the TCP dial should try, so a host backed by several A/AAAA records can fall back when one is unreachable. - split_
remote_ ๐table - Splits
remote_tableinto an optional schema qualifier and the bare table name:"schema.table"โ(Some("schema"), "table"),"table"โ(None, "table"). - unsupported ๐
Type Aliasesยง
- RawColumn
Row ๐ - A raw
INFORMATION_SCHEMA.COLUMNSrow decoded by the driver: (name,data_type,column_type,precision,scale,fsp).