Sxnan opened a new issue, #773:
URL: https://github.com/apache/flink-agents/issues/773

   ### Search before asking
   
   - [x] I searched in the 
[issues](https://github.com/apache/flink-agents/issues) and found nothing 
similar.
   
   ### Description
   
   Found during integrate_with_flink doc verification (#743).
   
   The Java DataStream snippet in
   `docs/content/docs/development/integrate_with_flink.md` (lines 76-89) 
contains
   a method reference on an undefined symbol:
   
   ```java
   DataStream<YourPojo> inputStream = env.fromSource(...);
   
   DataStream<Object> outputStream =
           agentsEnv
                   .fromDataStream(inputStream, (KeySelector<YourPojo, String>) 
x::getId)
                   .apply(yourAgent)
                   .toDataStream();
   ```
   
   `x::getId` requires `x` to be a declared variable/parameter in scope, but the
   snippet never introduces `x`. Pasting this snippet into a real Java file
   produces:
   
   ```
   error: cannot find symbol
     symbol:   variable x
   ```
   
   The intended form is an unbound method reference on the class `YourPojo`,
   i.e. `YourPojo::getId`.
   
   For comparison, the existing example
   `examples/.../WorkflowMultipleAgentExample.java:172` sidesteps this by
   instantiating a `KeySelector` subclass:
   
   ```java
   .fromTable(inputTable, new TableReviewAnalysisAgent.RowKeySelector())
   ```
   
   Fix: change `x::getId` to `YourPojo::getId` (or, equivalently, the lambda
   form `(KeySelector<YourPojo, String>) pojo -> pojo.getId()`).
   
   ### How to reproduce
   
   Copy the Java snippet from the doc into a Java class and compile.
   
   ### Version and environment
   
   Flink Agents 0.3.0 (`main`).
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to