I'm processing public budget data with Rakudo v2023.04 (Raku v6.d) using the module Text::CSV 0.012.
The input file has 150000 lines (records) and I try to load just one column (field) with:
my Str $data = slurp $file_name; my $fh = IO::String.new($data); my $csv = Text::CSV.new(';', '"'); my @column = $csv.getline_all($fh).map( *[$target_col] );
When executing I get:
> raku clean_class.raku PPP_DSP_2002-2021.csv Flattened array has 150000 elements, but argument lists are limited to + 65535 in method print at C:\workbench\budget\lib\IO\String.pm6 (IO::String +) line 40 in method new at C:\workbench\budget\lib\IO\String.pm6 (IO::String) +line 26 in method new at C:\workbench\budget\lib\IO\String.pm6 (IO::String) +line 13 in sub MAIN at clean_class.raku line 77 in block at 'SETTING::'src/core.c/Main.pm6 line 421 in sub RUN-MAIN at 'SETTING::'src/core.c/Main.pm6 line 416 in block <unit> at clean_class.raku line 15
As a workaround, I substituted line 40 of IO::String
@!content.push: |@x;
with
@!content.push: $_ for @x;
and the script runs without complaints.
I'm wondering if some other solution could be feasible?
Thanks and greetings.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |