Open Eason0729 opened 1 month ago
I would like to take stacker
approach, that is:
If those words aren't enough to explain the approach I would like to take, I can submit a draft PR to make it clear with code.
Related discussions about recursion limits:
https://docs.rs/sqlparser/latest/sqlparser/parser/struct.Parser.html#method.with_recursion_limit
I spent some time manually run reg read sp fp
, and write down rbp-rsp
(in debug build.
In this example, sqlparser consume about 140KB stack at peak, so I think there is little to optimize in sqlparser
.
I would try, but we still need to reduce stack usage on datafusion.
I am busy doing some school works recently (would probably stay busy until the end of this semester), so if there is anyone interested in this issue, feel free to work on it.
I will try to reproduce it with https://github.com/apache/datafusion/pull/13177 next week, chances are that it's related.
related to https://github.com/apache/datafusion/issues/12731
The issue is that unoptimized(debug) build consume more stack memory, which known to cause stack overflow if stack size is less than 1MiB.
Expected change: