[
https://issues.apache.org/jira/browse/CALCITE-2636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17945539#comment-17945539
]
Julian Hyde commented on CALCITE-2636:
--------------------------------------
Yes, it would be difficult to upgrade JavaCC.
But my original fix is still good. And the problem still exists: my fix
improved a test with a 2MB query from 147s to .6s. I rebased the fix and
created a PR.
[~mbudiu], Can you please review & merge PR 4316. (Or [~gian], if you feel like
doing that review after 6 years!)
> SQL parser has quadratic running time when SQL string is very large
> -------------------------------------------------------------------
>
> Key: CALCITE-2636
> URL: https://issues.apache.org/jira/browse/CALCITE-2636
> Project: Calcite
> Issue Type: Bug
> Reporter: Julian Hyde
> Priority: Major
> Labels: pull-request-available
>
> SQL parser has quadratic running time when SQL string is very large.
> This is due to {{SimpleCharStream.ExpandBuff(boolean)}} increasing the buffer
> in increments of 2,048 (2k) chars. If the SQL string is, say, 1,024k
> characters, then it will re-alloc at size 2k, 4k, 6k, ..., 1023k, and each
> time copy the whole string.
> This issue was discovered by [~gian].
--
This message was sent by Atlassian Jira
(v8.20.10#820010)