joeyutong commented on issue #1308:
URL: https://github.com/apache/flink-agents/issues/1308#issuecomment-6331491273

   ### Additional finding: Java Quickstart input silently skips one review 
(example data, low priority)
   
   This is an **example data defect** found while following the Quickstarts. 
The documentation prose does not need to change.
   
   **Documentation context:** the Java examples linked from [Single 
Agent](https://github.com/apache/flink-agents/blob/0c2388acc84a8620bfa0fc97b24fe5ede869b26d/docs/content/docs/get-started/quickstart/create-agent/single-agent.md#L38-L42),
 [Multiple 
Agents](https://github.com/apache/flink-agents/blob/0c2388acc84a8620bfa0fc97b24fe5ede869b26d/docs/content/docs/get-started/quickstart/create-agent/multiple-agents.md#L136-L151),
 
[ReAct](https://github.com/apache/flink-agents/blob/0c2388acc84a8620bfa0fc97b24fe5ede869b26d/docs/content/docs/get-started/quickstart/react_agent.md#L48-L50),
 and 
[YAML](https://github.com/apache/flink-agents/blob/0c2388acc84a8620bfa0fc97b24fe5ede869b26d/docs/content/docs/get-started/quickstart/yaml_agent.md#L49-L51)
 all use the same input resource.
   
   **Location:** 
[`examples/src/main/resources/input_data.txt:2488`](https://github.com/apache/flink-agents/blob/0c2388acc84a8620bfa0fc97b24fe5ede869b26d/examples/src/main/resources/input_data.txt#L2488).
 Two JSON objects are concatenated on one physical line:
   
   ```text
   {"id": "B005AGO4LU", "review": "I wear these everyday to work, the gym, 
etc."}{"id": "B0058YEJ5K", "review": "Love the fit"}
   ```
   
   The resource contains 3163 JSON objects but only 3162 nonempty lines. It 
should have one JSON object per line. A strict JSONL check reproduces the 
malformed line from the repository root:
   
   ```sh
   python3 - <<'PY'
   import json
   from pathlib import Path
   
   for number, line in enumerate(
       
Path("examples/src/main/resources/input_data.txt").read_text().splitlines(), 1
   ):
       if line.strip():
           try:
               json.loads(line)
           except json.JSONDecodeError as error:
               print(f"line {number}: {error}")
   PY
   ```
   
   **Real-job verification:** with Flink 2.3.0 and JDK 21, I executed two 
source-reading jobs using the unmodified resource and the newly built examples 
JAR:
   
   | Reading path | Completion | Parsed reviews | `B0058YEJ5K / Love the fit` |
   | --- | --- | ---: | ---: |
   | FileSource + TextLineInputFormat + Jackson readValue to the example 
ProductReview type | Successful | 3162 | 0 |
   | Table filesystem connector + JSON format | Successful | 3162 | 0 |
   
   The target review occurs once in the raw objects. Matching uses both `id` 
and `review`, since the same product ID has other reviews. In the line-based 
Jackson path, the first object is parsed and the second is left unread under 
the current configuration. The rebuilt examples JAR contains the same malformed 
resource bytes.
   
   **Impact:** one review is omitted from subsequent processing. The basic 
demonstration can still run, so this is a low-priority sample-data completeness 
issue. These probes executed input reading/parsing only; no model calls or 
complete Ollama Quickstart runs were performed.
   
   **Suggested minimal fix:** add the missing newline between the two objects, 
rebuild the examples JAR, and validate that each nonempty line contains exactly 
one JSON object and both readers produce all 3163 reviews.
   
   


-- 
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