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

Krzysztof Chmielewski edited comment on FLINK-31021 at 2/11/23 2:10 PM:
------------------------------------------------------------------------

Ok so I verified and it seems that this is NOT a regression caused by my recent 
change to Code Splitter. 
It seems that splitting static methods was never supported. I've checked on 
1.15 branch.

I think that the question we should ask here is this in fact a bug and do we 
need to make Code Splitter to handle Static methods? Quating [~TsReaper] from 
https://github.com/apache/flink/pull/21393#pullrequestreview-1273870828
{code:java}
Our code splitter is not a universal solution. It only works for Flink 
generated code under several restrictions.
{code}

Having said that, [~xccui] is there Flink SQL query that makes Planner to 
generate Java code with static methods? If so, could you provide one?

If in fact this is needed feature I can work on it since recently I've made 
bigger changes to code splitter and I would be fairly easy for me to add this.


[~TsReaper] What do you think?



was (Author: kristoffsc):
Ok so I verified and it seems that this is NOT a regression caused by my recent 
change to Code Splitter. 
It seems that splitting static methods was never supported. I've checked on 
1.15 branch.

I think that the question we should ask here is this in fact a bug and do we 
need to make Code Splitter to handle Static methods? Quating [~TsReaper] from 
https://github.com/apache/flink/pull/21393#pullrequestreview-1273870828
{code:java}
Our code splitter is not a universal solution. It only works for Flink 
generated code under several restrictions.
{code}

[~xccui] is there any Flink SQL query that makes Planner to generate Java code 
with static methods?
If so, could you provide one?

If in fact this is needed feature I can work on it since recently I've made 
bigger changes to code splitter and I would be fairly easy for me to add this.


[~TsReaper] What do you think?


> JavaCodeSplitter doesn't split static method properly
> -----------------------------------------------------
>
>                 Key: FLINK-31021
>                 URL: https://issues.apache.org/jira/browse/FLINK-31021
>             Project: Flink
>          Issue Type: Bug
>    Affects Versions: 1.14.4, 1.15.3, 1.16.1
>            Reporter: Xingcan Cui
>            Priority: Minor
>
> The exception while compiling the generated source
> {code:java}
> cause=org.codehaus.commons.compiler.CompileException: Line 3383, Column 90: 
> Instance method "default void 
> org.apache.flink.formats.protobuf.deserialize.GeneratedProtoToRow_655d75db1cf943838f5500013edfba82.decodeImpl(foo.bar.LogData)"
>  cannot be invoked in static context,{code}
> The original method header 
> {code:java}
> public static RowData decode(foo.bar.LogData message){{code}
> The code after split
>  
> {code:java}
> Line 3383: public static RowData decode(foo.bar.LogData message){ 
> decodeImpl(message); return decodeReturnValue$0; } 
> Line 3384:
> Line 3385: void decodeImpl(foo.bar.LogData message) {{code}
>  
>  



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

Reply via email to