You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "wzhvivl (via GitHub)" <gi...@apache.org> on 2026/02/06 17:26:21 UTC
[I] SanityCheckPlan caused by Error during planning: [datafusion]
wzhvivl opened a new issue, #20194:
URL: https://github.com/apache/datafusion/issues/20194
### Describe the bug
Hello, below is a simple query which is executing fine on 50.3.0 and started failing on 52.1.0.
### To Reproduce
CREATE TABLE table_1 (
value_1_1 decimal(25) NULL,
value_1_2 int4 NULL,
value_1_3 bigint NULL
);
CREATE TABLE table_2 (
value_2_1 bigint NULL,
value_2_2 varchar(140) NULL,
value_2_3 varchar(140) NULL
);
INSERT INTO table_1 (value_1_1,value_1_2,value_1_3) VALUES (6774502793, 10040029, 1120);
INSERT INTO table_2 (value_2_1, value_2_2, value_2_3) VALUES(1120,'0','0');
SELECT
t1.value_1_1, t1.value_1_2
, ROW_NUMBER()
OVER
(
PARTITION BY t1.value_1_1, t1.value_1_2 ORDER BY
case when t2.value_2_2='0' then 1 else 0 end ASC,
case when t2.value_2_3='0' then 1 else 0 end ASC
) ord
FROM table_1 t1
INNER JOIN table_2 t2
ON 1=1
AND t1.value_1_3=t2.value_2_1
AND (nvl(t2.value_2_3,'0')='0');
### Expected behavior
Query finishing without error.
### Additional context
Error message is:
SanityCheckPlan
caused by
Error during planning: Plan: [BoundedWindowAggExec: wdw=[row_number() PARTITION BY [t1.value_1_1, t1.value_1_2] ORDER BY [CASE WHEN t2.value_2_2 = Utf8(\0\) THEN Int64(1) ELSE Int64(0) END ASC NULLS LAST, CASE WHEN t2.value_2_3 = Utf8(\0\) THEN Int64(1) ELSE Int64(0) END ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { \row_number() PARTITION BY [t1.value_1_1, t1.value_1_2] ORDER BY [CASE WHEN t2.value_2_2 = Utf8(\\\0\\\) THEN Int64(1) ELSE Int64(0) END ASC NULLS LAST, CASE WHEN t2.value_2_3 = Utf8(\\\0\\\) THEN Int64(1) ELSE Int64(0) END ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW\: UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted],
SortExec: expr=[value_1_1@0 ASC NULLS LAST, value_1_2@1 ASC NULLS LAST, CASE WHEN value_2_2@2 = CASE WHEN value_2_3@3 IS NOT NULL THEN value_2_3@3 ELSE 0 END THEN 1 ELSE 0 END ASC NULLS LAST, CASE WHEN value_2_3@3 = CASE WHEN value_2_3@3 IS NOT NULL THEN value_2_3@3 ELSE 0 END THEN 1 ELSE 0 END ASC NULLS LAST], preserve_partitioning=[true],
RepartitionExec: partitioning=Hash([value_1_1@0, value_1_2@1], 16), input_partitions=1,
ProjectionExec: expr=[value_1_1@2 as value_1_1, value_1_2@3 as value_1_2, value_2_2@0 as value_2_2, value_2_3@1 as value_2_3],
HashJoinExec: mode=CollectLeft, join_type=Inner, on=[(value_2_1@0, value_1_3@2)], projection=[value_2_2@1, value_2_3@2, value_1_1@3, value_1_2@4],
FilterExec: CASE WHEN value_2_3@2 IS NOT NULL THEN value_2_3@2 ELSE 0 END = 0,
DataSourceExec: partitions=1, partition_sizes=[1],
DataSourceExec: partitions=1, partition_sizes=[1]] does not satisfy order requirements: [value_1_1@0 NA, value_1_2@1 NA, CASE WHEN value_2_2@2 = 0 THEN 1 ELSE 0 END ASC NULLS LAST, CASE WHEN value_2_3@3 = 0 THEN 1 ELSE 0 END ASC NULLS LAST]. Child-0 order: [[value_1_1@0 ASC NULLS LAST, value_1_2@1 ASC NULLS LAST, CASE WHEN value_2_2@2 = CASE WHEN value_2_3@3 IS NOT NULL THEN value_2_3@3 ELSE 0 END THEN 1 ELSE 0 END ASC NULLS LAST, CASE WHEN value_2_3@3 = CASE WHEN value_2_3@3 IS NOT NULL THEN value_2_3@3 ELSE 0 END THEN 1 ELSE 0 END ASC NULLS LAST]]
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] SanityCheckPlan caused by Error during planning: [datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #20194: SanityCheckPlan caused by Error during planning:
URL: https://github.com/apache/datafusion/issues/20194
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] SanityCheckPlan caused by Error during planning: [datafusion]
Posted by "EeshanBembi (via GitHub)" <gi...@apache.org>.
EeshanBembi commented on issue #20194:
URL: https://github.com/apache/datafusion/issues/20194#issuecomment-3871959533
/assign
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] SanityCheckPlan caused by Error during planning: [datafusion]
Posted by "Sahitya0805 (via GitHub)" <gi...@apache.org>.
Sahitya0805 commented on issue #20194:
URL: https://github.com/apache/datafusion/issues/20194#issuecomment-3870544557
Hi, I would like to work on this issue. Could you please assign it to me?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org