Skip to content

Query progress no longer works with CTEs #18017

@staticlibs

Description

@staticlibs

What happens?

The following example prints 25 on v1.3-ossivalis and 0.0996016 on main.

It is suspected to be related to #17459, CC: @kryonix.

To Reproduce

TEST_CASE("Test query progress", "[query_progress]") {
  DuckDB db;
  Connection conn(db);
  conn.Query("CREATE TABLE test_fib1(i bigint, p double, f double)");
  conn.Query("INSERT INTO test_fib1 values(1, 0, 1)");
  conn.Query("SET enable_progress_bar = true");

  std::thread th([&conn] {
      std::this_thread::sleep_for(std::chrono::milliseconds(1500));
      std::cout << conn.context->GetQueryProgress().GetPercentage() << std::endl;
      conn.Interrupt();
  });

  conn.Query(R"(
WITH RECURSIVE cte AS (
  SELECT * from test_fib1 UNION ALL SELECT cte.i + 1, cte.f, cte.p + cte.f from cte WHERE cte.i < 150000
) 
SELECT avg(f) FROM cte,
)");

  th.join();
}

OS:

Linux

DuckDB Version:

main

DuckDB Client:

unittest

Hardware:

x86_64

Full Name:

Alex Kasko

Affiliation:

DuckDB Labs

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a source build

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions