The world's fastest open query engine for sub-second analytics both on and off the data lakehouse. With the flexibility to support nearly any scenario, StarRocks provides best-in-class performance for multi-dimensional analytics, real-time analytics, and ad-hoc queries. A Linux Foundation project.
CREATE TABLE tpch_100g_partsupp (
PS_PARTKEY int(11) NOT NULL COMMENT "",
PS_SUPPKEY int(11) NOT NULL COMMENT "",
PS_AVAILQTY int(11) NOT NULL COMMENT "",
PS_SUPPLYCOST decimal64(15, 2) NOT NULL COMMENT "",
PS_COMMENT varchar(199) NOT NULL COMMENT ""
) ENGINE=OLAP
DUPLICATE KEY(PS_PARTKEY)
COMMENT "OLAP"
DISTRIBUTED BY HASH(PS_PARTKEY) BUCKETS 12
PROPERTIES (
"replication_num" = "1",
"in_memory" = "false",
"storage_format" = "DEFAULT"
);
select ref_1.PS_SUPPKEY as c0, case when ref_0.inv_quantity_on_hand < ref_1.PS_AVAILQTY then ref_0.inv_date_sk
else ref_0.inv_date_sk end as c1, ref_0.inv_warehouse_sk as c2, 18 as c3, cast( nullif(ref_1.PS_COMMENT, ref_1.PS_COMMENT) as VARCHAR ) as c4, 71 as c5, ref_0.inv_warehouse_sk as c6, case when ref_1.PS_SUPPKEY < ref_0.inv_date_sk then max( cast( cast( nullif(ref_1.PS_AVAILQTY, ref_0.inv_date_sk) as INT ) as INT ) ) over ( partition by ref_0.inv_date_sk order by ref_1.PS_COMMENT ) else max( cast( cast(
nullif(ref_1.PS_AVAILQTY, ref_0.inv_date_sk) as INT ) as INT ) ) over ( partition by ref_0.inv_date_sk order by ref_1.PS_COMMENT ) end as c7, pi() as c8, ref_0.inv_warehouse_sk as c9, cast( coalesce(ref_1.PS_PARTKEY, ref_0.inv_warehouse_sk) as INT ) as c10 from tpcds_100g_inventory as ref_0 inner join tpch_100g_partsupp as ref_1 on (ref_0.inv_quantity_on_hand = ref_1.PS_PARTKEY) where ref_1.PS_SUPPKEY >= ref_0.inv_item_sk limit 158;
Steps to reproduce the behavior (Required)
tpcds_100g_inventory
(inv_date_sk
int(11) NOT NULL COMMENT "",inv_item_sk
int(11) NOT NULL COMMENT "",inv_warehouse_sk
int(11) NOT NULL COMMENT "",inv_quantity_on_hand
int(11) NULL COMMENT "" ) ENGINE=OLAP DUPLICATE KEY(inv_date_sk
,inv_item_sk
,inv_warehouse_sk
) COMMENT "OLAP" DISTRIBUTED BY HASH(inv_date_sk
,inv_item_sk
,inv_warehouse_sk
) BUCKETS 5 PROPERTIES ( "replication_num" = "1", "in_memory" = "false", "storage_format" = "DEFAULT" );tpch_100g_partsupp
(PS_PARTKEY
int(11) NOT NULL COMMENT "",PS_SUPPKEY
int(11) NOT NULL COMMENT "",PS_AVAILQTY
int(11) NOT NULL COMMENT "",PS_SUPPLYCOST
decimal64(15, 2) NOT NULL COMMENT "",PS_COMMENT
varchar(199) NOT NULL COMMENT "" ) ENGINE=OLAP DUPLICATE KEY(PS_PARTKEY
) COMMENT "OLAP" DISTRIBUTED BY HASH(PS_PARTKEY
) BUCKETS 12 PROPERTIES ( "replication_num" = "1", "in_memory" = "false", "storage_format" = "DEFAULT" );Expected behavior (Required)
Query returns correctly
Real behavior (Required)
StarRocks version (Required)
select current_version()
branch-2.2 release 55c6918