Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecursionLimitedExceeded received for some sqlite test queries #14091

Open
Omega359 opened this issue Jan 11, 2025 · 2 comments · May be fixed by #14095
Open

RecursionLimitedExceeded received for some sqlite test queries #14091

Omega359 opened this issue Jan 11, 2025 · 2 comments · May be fixed by #14095
Assignees
Labels
bug Something isn't working

Comments

@Omega359
Copy link
Contributor

Describe the bug

datafusion-testing/data/sqlite/index/in/10/slt_good_4.slt

CREATE TABLE tab0(pk INTEGER PRIMARY KEY, col0 INTEGER, col1 FLOAT, col2 TEXT, col3 INTEGER, col4 FLOAT, col5 TEXT);
INSERT INTO tab0 VALUES(0,85,7.55,'fhtqr',23,66.64,'tipmz');
INSERT INTO tab0 VALUES(1,45,84.93,'ddkjn',69,1.7,'zvjtx');
INSERT INTO tab0 VALUES(2,40,19.43,'odsdy',31,46.53,'covoz');
INSERT INTO tab0 VALUES(3,77,14.17,'sfufb',32,33.15,'emsfi');
INSERT INTO tab0 VALUES(4,13,29.59,'vamro',68,25.93,'tmjmw');
INSERT INTO tab0 VALUES(5,60,30.53,'wazrh',75,4.88,'jggox');
INSERT INTO tab0 VALUES(6,16,88.42,'cvmis',1,2.9,'fsqiw');
INSERT INTO tab0 VALUES(7,50,95.34,'ucrau',71,76.93,'tvemu');
INSERT INTO tab0 VALUES(8,36,67.21,'tsqmj',86,77.13,'iaona');
INSERT INTO tab0 VALUES(9,62,79.85,'abcxx',16,3.91,'ubdbw');
SELECT pk FROM tab0 WHERE (col3 = 51 AND col0 < 12 OR (col1 > 85.47) AND col1 = 18.10 OR col0 > 53 AND (col3 > 13 OR ((col1 >= 1.85)) AND ((col4 > 13.86 AND col0 < 2) OR col4 > 42.90) OR (col4 > 41.96))) AND (col3 > 62 AND (col3 < 6 AND ((col0 <= 92)) OR ((col4 < 55.45 AND col3 > 80 AND (col0 >= 92 AND ((col3 = 76) AND (col3 IN (SELECT col0 FROM tab0 WHERE (col1 > 73.88) OR ((col3 > 71) AND (col0 < 97))) OR (col3 >= 65) AND ((col3 < 30))) AND (((col1 BETWEEN 61.46 AND 86.35))) AND col3 >= 14) OR ((col0 = 80)) AND col4 IN (28.76,45.57,47.50,9.79) OR (col3 < 68 AND (col3 >= 16 OR (((col1 > 40.2))) AND col0 = 7 AND (((((col3 < 50 OR (col3 <= 8 AND col3 > 65 AND col1 <= 21.7 OR ((col4 >= 37.78 AND ((col0 > 90) OR ((((col1 < 93.58) OR col0 = 55 AND ((col4 > 44.29) OR (col3 <= 85 OR col3 BETWEEN 76 AND 82)) AND col0 = 33 OR (col3 = 32 OR col4 < 73.63) AND (((((col0 IS NULL))))) AND ((col1 BETWEEN 45.38 AND 73.13) OR col1 <= 83.99) AND col0 > 99)) AND col1 >= 55.73 OR col3 < 77 OR (col0 = 13 OR (col4 > 3.17) AND (col0 > 96) AND (((((col1 > 17.78)))) AND ((col3 < 66 OR (col3 > 16 OR ((col0 IS NULL) OR col1 <= 9.52 AND col1 > 11.87 AND ((col3 IS NULL AND (col0 < 84 OR col1 > 28.46) OR col0 < 96))))))) OR col0 > 65 OR col3 > 33 AND (col0 > 42)) AND col0 > 50 OR col0 IN (5,15,53,41,15))) OR ((col0 >= 40) AND col0 > 51)))))) AND col0 IN (18,83,22) OR col3 > 2 OR col0 IN (13,8,87,46) AND col3 < 30 OR col4 IS NULL AND col3 = 27 OR col4 <= 49.70) OR col0 <= 88)) AND (col3 > 78)) AND col1 > 83.16) AND col4 > 49.5 OR ((col1 > 90.83))) AND (((col0 < 5 AND col0 > 59)) AND (col4 >= 83.46) OR col1 = 97.95)) OR col4 < 46.22 OR col3 <= 49 OR ((((((col0 < 37)))) AND col1 > 48.46 OR (((col4 < 19.96 AND (col1 >= 99.50 AND col3 >= 79 AND col3 >= 91) AND col4 < 8.9 OR col4 >= 96.66 AND col3 < 95))) OR col3 < 37 OR ((col4 >= 49.98)))))) OR col0 >= 87) OR col3 > 8;

datafusion-testing/data/sqlite/index/in/10/slt_good_1.slt

CREATE TABLE tab0(pk INTEGER PRIMARY KEY, col0 INTEGER, col1 FLOAT, col2 TEXT, col3 INTEGER, col4 FLOAT, col5 TEXT);
INSERT INTO tab0 VALUES(0,6,72.32,'diidw',65,65.1,'uudvn');
INSERT INTO tab0 VALUES(1,57,90.1,'jvnyz',84,48.99,'raktj');
INSERT INTO tab0 VALUES(2,68,91.83,'wefta',37,71.86,'zddoc');
INSERT INTO tab0 VALUES(3,10,78.14,'zwjtc',7,9.96,'epmyn');
INSERT INTO tab0 VALUES(4,63,24.41,'rwaus',66,53.7,'gbgmw');
INSERT INTO tab0 VALUES(5,87,70.88,'rwpww',46,26.5,'bvbew');
INSERT INTO tab0 VALUES(6,76,46.18,'lfvrf',99,92.47,'hqpgb');
INSERT INTO tab0 VALUES(7,25,81.99,'khylz',54,73.22,'qaonp');
INSERT INTO tab0 VALUES(8,93,17.58,'clxlk',88,59.16,'ziwhr');
INSERT INTO tab0 VALUES(9,64,18.54,'fgkop',82,18.73,'lztum');
SELECT pk FROM tab0 WHERE col0 IN (SELECT col3 FROM tab0 WHERE (col3 = 87 OR col0 > 47 AND (col0 BETWEEN 8 AND 79) OR col3 <= 28 AND (((col3 > 74 AND col1 IN (48.31,29.5,55.50,10.95,94.4,37.35) OR col0 IN (4,46,13) OR col1 > 46.32 AND (((col1 = 31.94)) OR col3 IS NULL) AND ((col0 IN (52,21,61,45) OR col1 BETWEEN 36.77 AND 87.56 AND (col1 > 25.86) AND col3 > 84 OR col0 = 40 AND (((col3 <= 74)) OR (col4 < 62.74))) AND col0 = 61)))) AND ((((col3 <= 80 OR col3 < 57 AND (col3 <= 11 OR col0 >= 7) OR ((col1 < 14.66 AND ((col1 > 71.36 AND col4 > 96.61 OR col0 >= 30 AND (col4 > 29.82) OR (col0 <= 48) AND ((col0 < 93 OR (((col3 <= 92) OR col3 < 68)))) AND col0 >= 36 OR col3 <= 60)) AND (col3 = 94 AND col3 = 27 OR col1 < 21.90) OR col3 IN (SELECT col0 FROM tab0 WHERE col4 IS NULL) AND col3 <= 41 OR col0 <= 75 AND col3 >= 6 AND col4 < 96.50)) OR ((col4 IS NULL) AND col0 IS NULL AND (((col0 = 58))) AND col0 < 9 AND col4 = 94.97)) AND col0 < 0 OR col0 <= 11) AND ((((((col3 >= 57) AND col3 <= 82) AND (col1 >= 42.63 AND col4 IN (17.61) AND col3 >= 10 AND col1 > 2.44 AND col1 >= 52.85 OR col3 > 53) AND col1 = 12.6 AND ((((col4 = 14.62 AND (col3 < 42)) AND (col3 < 36)) AND (col1 = 99.69)) OR col0 BETWEEN 78 AND 21) AND (col3 <= 24 AND col1 BETWEEN 67.77 AND 31.57 OR (col3 < 47)))))) AND ((((col1 < 0.97 AND col4 = 0.26 AND ((col3 < 59) AND col1 IS NULL AND col3 <= 44 OR col3 > 98 OR (((((col0 < 62) OR col3 < 80) AND (col1 >= 28.79 OR ((col4 > 74.30) AND (col0 <= 85)) AND (((col0 <= 84 OR (((col0 < 26) OR ((col3 > 42)) AND (col0 > 74) AND (col1 > 29.71 OR col3 > 25 AND col0 < 95 OR col3 IN (61,83,47,69,4)) AND (col1 IN (81.42,14.81,74.85,18.61,71.48) AND ((col3 < 14 AND col0 >= 68 OR ((col4 = 26.30) AND (col0 <= 1) AND (col1 > 58.61)) OR col4 > 41.65 AND (col3 < 21) AND col0 <= 15 OR col1 < 18.74 AND ((col4 = 40.39 OR (col3 = 50))) AND col0 > 52 AND col3 IN (20,24) AND col0 <= 77 OR col1 > 83.56 OR col3 <= 99 AND ((col4 IN (SELECT col1 FROM tab0 WHERE ((col4 = 63.0) OR (col1 <= 80.20 AND col0 IN (SELECT col3 FROM tab0 WHERE ((col4 > 62.20) AND (col3 <= 97)))) AND ((col4 = 25.48)) AND col0 > 14) AND (col3 <= 73) AND col4 IN (SELECT col1 FROM tab0 WHERE col4 < 66.98)) AND col3 > 35) AND (col3 >= 73) AND col4 >= 33.81 OR (col1 <= 21.42))))) AND col0 IN (94,19,12,35,9)) OR col4 > 18.99))) OR col1 IS NULL) AND col1 = 4.25 AND col1 > 75.22 OR col3 > 12)) OR (col4 BETWEEN 31.93 AND 83.85) AND col0 IS NULL)) OR ((col0 < 0)) AND (col3 IN (8)) AND col3 <= 32) OR (col0 IN (73,93,48,71)))) OR col4 > 29.25)) AND col3 > 46) OR col3 >= 30) AND col4 > 32.99 OR col3 < 49 OR ((col3 >= 12)) AND col3 > 38));

To Reproduce

Run the above sql.

Expected behavior

No error.

Additional context

No response

@Omega359 Omega359 added the bug Something isn't working label Jan 11, 2025
@tlm365
Copy link
Contributor

tlm365 commented Jan 12, 2025

Looks like the error is coming from sqlparser-rs and not datafusion.

Edit: Actually, it's an intentional choice (source). I think we can tweak this configuration on the datafusion side.

@tlm365
Copy link
Contributor

tlm365 commented Jan 12, 2025

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants