[ 
https://issues.apache.org/jira/browse/CALCITE-2662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16680695#comment-16680695
 ] 

Julian Hyde commented on CALCITE-2662:
--------------------------------------

I'm skeptical that this will give a significant performance improvement. Unless 
the SQL is mostly comments or whitespace, if the parser reads SQL of size X 
then it will use memory of many times X for the AST it produces. Still, no 
reason not to do this.

Could the API use a Reader rather than an InputStream? Then we can leave 
Charset out of the equation.

We need some tests, and not just in ubenchmark. E.g. can it produce errors at 
with the right line/column location?

> Planner: allow parsing directly a stream instead of a java.lang.String
> ----------------------------------------------------------------------
>
>                 Key: CALCITE-2662
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2662
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.17.0
>            Reporter: Enrico Olivelli
>            Assignee: Julian Hyde
>            Priority: Major
>
> In 1.17.0 the org.apache.calcite.tools.Planner interface only accept a 
> java.lang.String as input.
> In order to reduce memory allocations and copies it will be useful that the 
> planner could accept the query in a more 'raw' format.
> Creating a java.lang.String is very expensive, and if your "query" is coming 
> from the network (think about a Netty Direct memory ByteBuf) you are forced 
> to create a copy of the text of the query.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to