greptimedb
greptimedb copied to clipboard
Storing necessary fields instead of the entire `QueryContext` struct
It's better to store only the necessary fields instead of the entire `QueryContext` struct. I'm going to convert this PR into an issue and plan to refactor it in the future.
Originally posted by @WenyXu in https://github.com/GreptimeTeam/greptimedb/issues/5200#issuecomment-2572399879
@WenyXu Can we turn this into a good first issue if you provide more context for it?
https://github.com/GreptimeTeam/greptimedb/blob/52eebfce77b63d8289dad0c74513d1700ae00bf1/src/common/meta/src/ddl/create_flow.rs#L326-L338
We don't need to store the entire QueryContext, only store the required fields of QueryContext in CreateFlowData. e.g., schema, catalog, timezone.
https://github.com/GreptimeTeam/greptimedb/blob/52eebfce77b63d8289dad0c74513d1700ae00bf1/src/common/meta/src/rpc/ddl.rs#L1205-L1212