平面文件的 trino 连接器

问题描述 投票:0回答:1

我正在尝试创建 trino 连接器来查询平面文件中可用的数据(比如一个包含 100 条记录的文本文件,每条记录用换行符分隔,每列用逗号分隔)。 Trino 文档页面 (https://trino.io/docs/current/connector/localfile.html) 展示了如何为 LocalFile 创建连接器,但它仅适用于 HTTP 日志。谁能帮我。提前致谢。

flat-file trino query-engine
1个回答
0
投票

正如您已经提到的,它仅适用于 HTTP 日志和列是硬编码

private static final List<ColumnMetadata> COLUMNS = ImmutableList.of(
                SERVER_ADDRESS_COLUMN,
                new ColumnMetadata("timestamp", createTimestampWithTimeZoneType(3)),
                new ColumnMetadata("client_address", createUnboundedVarcharType()),
                new ColumnMetadata("method", createUnboundedVarcharType()),
                new ColumnMetadata("request_uri", createUnboundedVarcharType()),
                new ColumnMetadata("user", createUnboundedVarcharType()),
                new ColumnMetadata("agent", createUnboundedVarcharType()),
                new ColumnMetadata("response_code", BIGINT),
                new ColumnMetadata("request_size", BIGINT),
                new ColumnMetadata("response_size", BIGINT),
                new ColumnMetadata("time_to_last_byte", BIGINT),
                new ColumnMetadata("trace_token", createUnboundedVarcharType()));
© www.soinside.com 2019 - 2024. All rights reserved.