substrait-io / duckdb-substrait-extension

MIT License
28 stars 22 forks source link

get_substrait does not support DELIM_JOIN #117

Open EpsilonPrime opened 1 week ago

EpsilonPrime commented 1 week ago

The substrait integration is experimental. Support is currently only available on request.

What happens?

If you pass TPC-H query 2 to get_substrait() it complains that DELIM_JOIN Is not supported.

To Reproduce

install substrait;
load substrait;
install tpch;
load tpch;

.width -1
.mode csv
select query from tpch_queries() where query_nr=2;

FROM get_substrait("SELECT
      s_acctbal,
      s_name,
      n_name,
      p_partkey,
      p_mfgr,
      s_address,
      s_phone,
      s_comment
  FROM
      part,
      supplier,
      partsupp,
      nation,
      region
  WHERE
      p_partkey = ps_partkey
      AND s_suppkey = ps_suppkey
      AND p_size = 15
      AND p_type LIKE '%BRASS'
      AND s_nationkey = n_nationkey
      AND n_regionkey = r_regionkey
      AND r_name = 'EUROPE'
      AND ps_supplycost = (
          SELECT
              min(ps_supplycost)
          FROM
              partsupp,
              supplier,
              nation,
              region
          WHERE
              p_partkey = ps_partkey
              AND s_suppkey = ps_suppkey
              AND s_nationkey = n_nationkey
              AND n_regionkey = r_regionkey
              AND r_name = 'EUROPE')
  ORDER BY
      s_acctbal DESC,
      n_name,
      s_name,
      p_partkey
  LIMIT 100;
  "
  );

The result is:

INTERNAL Error: DELIM_JOIN

OS:

MacOS

Substrait-Extension Version:

v0.10.1 4a89d97db8

DuckDB Version:

v0.10.1 4a89d97db8

DuckDB Client:

CLI

Have you tried this on the latest master branch?

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

EpsilonPrime commented 1 week ago

Define sideband optimization hints #705 was added to the specification to help support the required feature on the DuckDB side.