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

James Duong edited comment on CALCITE-6465 at 8/2/24 10:57 PM:
---------------------------------------------------------------

I believe I've figured out how to use Flink's code splitter now. The entry 
point looks to be 
[JavaCodeSplitter#split()|[https://github.com/apache/flink/blob/cdf43aecafa33a50a4b4b6841c4cf505b195994a/flink-table/flink-table-code-splitter/src/main/java/org/apache/flink/table/codesplit/JavaCodeSplitter.java#L33]:]
 which just takes in a code string and some parameters for limits then fires 
off the code splitting.

 

I've started a simple [PR|https://github.com/apache/calcite/pull/3901] which 
just intercepts calls to Expressions.toString() and adds code splitting before 
returning the code string. Next step is to make this configurable.

 

As mentioned above, this is in the flink-table-code-splitter module which does 
have a dependency on flink-core. The flink-core dependency can't be excluded 
because the code splitter uses the Preconditions class from flink-core. I'm 
currently collaborating with the Flink community on this in 
https://lists.apache.org/thread/2x131qstnq3364c4j28zvdb9xsczlxrv


was (Author: jduong):
I believe I've figured out how to use Flink's code splitter now. The entry 
point looks to be 
[JavaCodeSplitter#split()|[https://github.com/apache/flink/blob/cdf43aecafa33a50a4b4b6841c4cf505b195994a/flink-table/flink-table-code-splitter/src/main/java/org/apache/flink/table/codesplit/JavaCodeSplitter.java#L33]:]
 which just takes in a code string and some parameters for limits then fires 
off the code splitting.

 

I've started a simple [PR|https://github.com/apache/calcite/pull/3901] which 
just intercepts calls to Expressions.toString() and adds code splitting before 
returning the code string. Next step is to make this configurable.

 

As mentioned above, this is in the flink-table-code-splitter module which does 
have a dependency on flink-core. The flink-core dependency can't be excluded 
because the code splitter uses the Preconditions class from flink-core. I'm 
currently collaborating with the Flink community on this in 
https://lists.apache.org/thread/2x131qstnq3364c4j28zvdb9xsczlxrv

> Rework code generator
> ---------------------
>
>                 Key: CALCITE-6465
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6465
>             Project: Calcite
>          Issue Type: New Feature
>          Components: core
>            Reporter: James Duong
>            Assignee: James Duong
>            Priority: Major
>              Labels: pull-request-available
>
> Holistically replace the (or provide a separate optional) code generator to 
> reduce issues such as CALCITE-3094 .
> One suggestion in the comments for CALCITE-3094 has been to use the [code 
> generator from 
> Flink.|https://nightlies.apache.org/flink/flink-docs-release-1.3/api/java/org/apache/flink/table/codegen/CodeGenerator.html]



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

Reply via email to