greptimedb icon indicating copy to clipboard operation
greptimedb copied to clipboard

Storing necessary fields instead of the entire `QueryContext` struct

Open WenyXu opened this issue 11 months ago • 2 comments

          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 avatar Jan 06 '25 06:01 WenyXu

@WenyXu Can we turn this into a good first issue if you provide more context for it?

evenyag avatar Jan 06 '25 07:01 evenyag

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

WenyXu avatar Jan 08 '25 10:01 WenyXu