async fn sql_to_df_plan_for_sink(
query_ctx: QueryContextRef,
engine: QueryEngineRef,
sql: &str,
sink_schema: &Schema,
) -> Result<LogicalPlan, Error>Expand description
Plans sql unoptimized, to be written into a sink table with sink_schema.
Before TQL flows were planned with plan_relation, a flow on the native PromQL route
auto-created its sink from the native plan’s own columns: the value named by that route, the
labels, and __name__ as a primary key column. A sink with __name__ is still written from the
statement’s own plan, so such a flow keeps writing the same columns and the same series keys.
plan_relation and plan only differ for a PromQL statement on the native route.