parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SQLite3 or DB Problem with Multiple Variables


From: Larry Ploetz
Subject: Re: SQLite3 or DB Problem with Multiple Variables
Date: Sun, 22 Mar 2020 23:01:33 -0700
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

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 - address@hidden 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 - address@hidden wrote:
Thanks! Everything seems to be working as (currently) expected.

- Larry

On 3/20/20 7:20 PM, Ole Tange - address@hidden wrote:
On Tue, Mar 17, 2020 at 8:22 PM Larry Ploetz <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]