Reputation: 712
I am trying to create trino connector to query the data available in a flat file (say a text file with 100 records, each record is separated by newline and each column separated by comma). Trino documentation page (https://trino.io/docs/current/connector/localfile.html) shows how to create a connector for LocalFile but it works only for HTTP logs. Can any one help me. Thanks in advance.
Upvotes: 0
Views: 886
Reputation: 761
As you already mentioned, it's only for HTTP logs and columns are hard-coded:
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()));
Upvotes: 2