[ 
https://issues.apache.org/jira/browse/CSV-274?focusedWorklogId=814483&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-814483
 ]

ASF GitHub Bot logged work on CSV-274:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Oct/22 19:29
            Start Date: 06/Oct/22 19:29
    Worklog Time Spent: 10m 
      Work Description: codecov-commenter commented on PR #270:
URL: https://github.com/apache/commons-csv/pull/270#issuecomment-1270582614

   # 
[Codecov](https://codecov.io/gh/apache/commons-csv/pull/270?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#270](https://codecov.io/gh/apache/commons-csv/pull/270?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (5fbd353) into 
[master](https://codecov.io/gh/apache/commons-csv/commit/f36e0f590b3882a810eefac04c092f83011526a4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (f36e0f5) will **decrease** coverage by `0.00%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #270      +/-   ##
   ============================================
   - Coverage     97.34%   97.34%   -0.01%     
     Complexity      535      535              
   ============================================
     Files            11       11              
     Lines          1169     1167       -2     
     Branches        205      203       -2     
   ============================================
   - Hits           1138     1136       -2     
     Misses           18       18              
     Partials         13       13              
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/commons-csv/pull/270?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[...rc/main/java/org/apache/commons/csv/CSVParser.java](https://codecov.io/gh/apache/commons-csv/pull/270/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvY3N2L0NTVlBhcnNlci5qYXZh)
 | `96.85% <ø> (ø)` | |
   | 
[...rc/main/java/org/apache/commons/csv/CSVFormat.java](https://codecov.io/gh/apache/commons-csv/pull/270/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvY3N2L0NTVkZvcm1hdC5qYXZh)
 | `97.15% <0.00%> (-0.01%)` | :arrow_down: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD 
build times. [Learn 
more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   




Issue Time Tracking
-------------------

    Worklog Id:     (was: 814483)
    Time Spent: 50m  (was: 40m)

> CSVParser.iterator() does not iterate over result set as expected.
> ------------------------------------------------------------------
>
>                 Key: CSV-274
>                 URL: https://issues.apache.org/jira/browse/CSV-274
>             Project: Commons CSV
>          Issue Type: Bug
>          Components: Parser
>    Affects Versions: 1.8
>            Reporter: David Guiney
>            Priority: Major
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> To return a stream of `CSVRecords` in a Spliterators, I need to call 
> `CSVParser.getRecords().iterator()`. I worry that the `getRecords()` will 
> load the records from the parser into memory, before creating the iterator 
> which can be a problem with large CSV files.
> My code: 
> {code:java}
>     public Stream<CSVRecord> convertFileToMaps(Path path) throws IOException {
>         try (CSVParser parser = CSVParser.parse(path, 
> Charset.defaultCharset(), CSVFormat.RFC4180
>             .withFirstRecordAsHeader())) {
>             return 
> StreamSupport.stream(Spliterators.spliteratorUnknownSize(parser.iterator(), 
> 0), false);
>         }
> }
> {code}
> and:
> {code:java}
>     public Stream<CSVRecord> convertFileToMaps(Path path) throws IOException {
>         try (CSVParser parser = CSVParser.parse(path, 
> Charset.defaultCharset(), CSVFormat.RFC4180
>             .withFirstRecordAsHeader())) {
>             return StreamSupport.stream(parser.spliterator(), false);
>         }
> }
> {code}
> When I collect the results of my method, it gives me
> {code:java}
> []
> {code}
>  
> If I replace `parser.iterator()` with `parser.getRecords().iterator()` then I 
> get the desired results. Is the iterator not meant to be an iterator of the 
> list of `CSVRecord`.



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

Reply via email to