Frank Chen created CALCITE-7810:
-----------------------------------

             Summary: Write Rex string literal digests directly
                 Key: CALCITE-7810
                 URL: https://issues.apache.org/jira/browse/CALCITE-7810
             Project: Calcite
          Issue Type: Sub-task
            Reporter: Frank Chen


String RexLiteral digest generation currently asks NlsString to build a 
complete SQL string and then copies that temporary string into the destination 
StringBuilder. Large literal ARRAYs repeat this allocation for every element.

Add NlsString.asSql overloads that append the escaped SQL representation 
directly to a caller-provided StringBuilder, while preserving ANSI dialect 
selection, charset-prefix handling, quote escaping, and existing output 
behavior.

The isolated Druid benchmark reduced allocation by 2.46% at 100,000 string 
literals and 1.31% at 1,000,000 string literals.

Pull request: [PR #5284|https://github.com/apache/calcite/pull/5284]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to