I forgot to change the command to something compatible with ‘--pipe’,
but that's not relevant to the issue:

    larryp-MBP:~ larry$ printf '%s %s\n' {a..d} | parallel -C ' ' --pipe while 
read first second\; do echo /\$first/\$second/\; done
    /a/b/
    /c/d/
    larryp-MBP:~ larry$ printf '%s %s\n' {a..d} | parallel -C ' ' 
--sqlandworker csv:///%2ftmp%2ffoo.csv/ba --pipe while read first second\; do 
echo /\$first/\$second/\; done
    DBI connect('','',...) failed: No such directory '/tmp/foo.csv at 
/Users/larry/bin/parallel line 12252.
    No such directory '/tmp/foo.csv at /Users/larry/bin/parallel line 12252.

Thanks!
— Larry

On 3/22/20 10:49 PM, Larry Ploetz - [email protected] wrote:

> Sorry Ole - I simplified my use case too much. On running it with the
> full set of Parallel operands I intend to use, I ran into a
> combination that doesn't work, or at least gives a misleading error
> message. Adding ‘--pipe’ to the simplified example causes this:
>
>     larryp-MBP:~ larry$ printf '%s %s\n' {a..d} | parallel -C ' ' 
> --sqlandworker csv:///%2ftmp%2ffoo.csv/bar --pipe echo /{1}/{2}/
>     DBI connect('','',...) failed: No such directory '/tmp/foo.csv at 
> /Users/larry/bin/parallel line 12252.
>     No such directory '/tmp/foo.csv at /Users/larry/bin/parallel line 12252.
>
>     larryp-MBP:~ larry$ printf '%s %s\n' {a..d} | parallel -C ' ' 
> --sqlandworker sqlite:///%2ftmp%2ffoo.sqlite/bar --pipe echo /{1}/{2}/
>     DBD::SQLite::db prepare failed: no such table: bar [for Statement "SELECT 
> * FROM bar LIMIT 1;"] at /Users/larry/bin/parallel line 12451.
>
> Thanks!
> — Larry
>
> On 3/21/20 12:05 AM, Larry Ploetz - [email protected] wrote:
>> Thanks! Everything seems to be working as (currently) expected.
>>
>> - Larry
>>
>> On 3/20/20 7:20 PM, Ole Tange - [email protected] wrote:
>>> On Tue, Mar 17, 2020 at 8:22 PM Larry Ploetz <[email protected]> wrote:
>>>
>>>> Well, I tried some things with CSV and got different errors:
>>>>
>>>> larryp-MBP:parallel larry$ printf '%s %s\n' {a..d} | gtee >(cat >&2) | 
>>>> src/parallel -C' ' --sqla csv:///%2ftmp%2ffoo.csv/bar echo /{1}/{2}/
>>>> a b
>>>> c d
>>>> parallel: Error:
>>>> Execution ERROR: Cannot open /Users/larry/git/parallel/bar: No such file 
>>>> or directory (2) at 
>>>> /opt/local/lib/perl5/site_perl/5.30/darwin-thread-multi-2level/DBI/DBD/SqlEngine.pm
>>>>  line 1624.
>>>>  called from src/parallel at 12446.
>>> I can reproduce your error when using the unsupported `--sqla`. But it
>>> is not a supported option. This works for me:
>>>
>>> printf '%s %s\n' {a..d} | tee >(cat >&2) | parallel -C' '
>>> --sqlandworker csv:///%2ftmp%2ffoo.csv/bar echo /{1}/{2}/
>>>
>>> I am not going to spend time on figuring out why --sqla does not work.
>>> If others find the reasons, I am cool with that.
>>>
>>>> larryp-MBP:parallel larry$ touch /tmp/foo.csv
>>>> larryp-MBP:parallel larry$ printf '%s %s\n' {a..d} | gtee >(cat >&2) | 
>>>> src/parallel -C' ' --sqla csv:///%2ftmp%2ffoo.csv/bar echo /{1}/{2}/
>>>> a b
>>>> c d
>>>> parallel: Error:
>>>> Execution ERROR: Cannot open /Users/larry/git/parallel/bar: No such file 
>>>> or directory (2) at 
>>>> /opt/local/lib/perl5/site_perl/5.30/darwin-thread-multi-2level/DBI/DBD/SqlEngine.pm
>>>>  line 1624.
>>>>  called from src/parallel at 12446.
>>> The same here: --sqla does not work, but this works for me:
>>>
>>> printf '%s %s\n' {a..d} | gtee >(cat >&2) | parallel -C' '
>>> --sqlandworker csv:///%2ftmp%2ffoo.csv/bar echo /{1}/{2}/
>>>
>>>> I'm assuming it's OK to use the full DBTABLEURL (variable from the 
>>>> example) value on the command line.
>>>>
>>>> However, with 1 variable this works,
>>> No. It works because you are writing --sqlandworker instead of --sqla.
>>>
>>>> but completely disregards the directory:
>>>> larryp-MBP:parallel larry$ parallel --sqlandworker 
>>>> csv:///%2FBOGUS%2FBOGUS2/mytable3 seq ::: {1..10}
>>> That looks like a bug in DBI. Thanks.
>>>
>>> /Ole
>>>
>>>
>

Attachment: pEpkey.asc
Description: application/pgp-keys

Reply via email to