async fn topk_plan() -> Result<()> {
    let mut ctx = setup_table(make_topk_context()).await?;

    let expected = vec![
        "| logical_plan after topk                 | TopK: k=3                                      |",
        "|                                         |   Projection: #customer_id, #revenue           |",
        "|                                         |     TableScan: sales projection=Some([0, 1])   |",
    ].join("\n");

    let explain_query = format!("EXPLAIN VERBOSE {}", QUERY);
    let actual_output = exec_sql(&mut ctx, &explain_query).await?;

    // normalize newlines (output on windows uses \r\n)
    let actual_output = actual_output.replace("\r\n", "\n");

    assert!(actual_output.contains(&expected) , "Expected output not present in actual output\nExpected:\n---------\n{}\nActual:\n--------\n{}", expected, actual_output);
    Ok(())
}
// Run EXPLAIN PLAN and show the plan was in fact rewritten
Run EXPLAIN PLAN and show the plan was in fact rewritten
Run EXPLAIN PLAN and show the plan was in fact rewritten
async fn topk_plan() -> Result<()> {
    let mut ctx = setup_table(make_topk_context()).await?;
    let expected = vec![
        "| logical_plan after topk                 | TopK: k=3                                      |",
        "|                                         |   Projection: #customer_id, #revenue           |",
        "|                                         |     TableScan: sales projection=Some([0, 1])   |",
    ].join("\n");
    let explain_query = format!("EXPLAIN VERBOSE {}", QUERY);
    let actual_output = exec_sql(&mut ctx, &explain_query).await?;
    // normalize newlines (output on windows uses \r\n)
    let actual_output = actual_output.replace("\r\n", "\n");
    assert!(actual_output.contains(&expected) , "Expected output not present in actual output\nExpected:\n---------\n{}\nActual:\n--------\n{}", expected, actual_output);
    Ok(())
}
async fn topk_plan ( ) -> Result < ( ) > { let mut ctx = setup_table ( make_topk_context ( ) ) . await ? ; let expected = vec ! [ " " " " " " ] . join ( " \n " ) ; let explain_query = format ! ( " " QUERY ) ; let actual_output = exec_sql ( & mut ctx , & explain_query ) . await ? ; // normalize newlines (output on windows uses \r\n) let actual_output = actual_output . replace ( " \r \n " , " \n " ) ; assert ! ( actual_output contains ( expected ) " \n \n \n \n \n \n " expected actual_output ) ; Ok ( ( ) ) }
Run EXPLAIN PLAN and show the plan was in fact rewritten
Run EXPLAIN PLAN and show the plan was in fact rewritten