[ 
https://issues.apache.org/jira/browse/CASSANDRA-9303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15066557#comment-15066557
 ] 

Paulo Motta commented on CASSANDRA-9303:
----------------------------------------

bq. That's correct, copy-to* sections are not read in from executions and 
vice-versa. I've added a check to explicitly skip invalid or wrong direction 
options from config files along with more log messages so that it should be 
easier to see that an option is not read or ignored.

Ok, my bad then. I tested with the previous version which did not have 
exclusive sections. I don't think it`s necessary to skip invalid options 
(within the exclusive sections) as they are harmless and their treating make 
the code a bit more complex. So just reverting to the previous approach should 
be fine, but feel free to keep the way it is if you think it's OK. Sorry about 
this confusion!

Regarding the printing of the read options, I was thinking of something more 
concise instead of a one-config-per-line which can get too verbose, something 
along the lines of:

{noformat}
Reading options from /home/paulo/.cassandra/cqlshrc:[copy-from]: 
{chunksize=100, ingestrate=100, wtf=102, numprocesses=5}
Reading options from 
/home/paulo/.cassandra/cqlshrc:[copy-from:keyspace1.standard1] : 
{ingestrate=200, invalid="true"}
Using 5 child processes
{noformat}

Two more things:

* Regarding {{COPY TO STDOUT}} should we skip printing info messages since a 
user may want to redirect the output to another script or file? Like {{echo 
"copy keyspace1.standard1 TO STDOUT  with SKIPCOLS = 'C2';" | bin/cqlsh | 
process.sh}}
* If I have an {{import.cql}} file containing {{COPY keyspace1.standard1 from 
stdin;}} is the following supposed to work: {{cat input.csv | bin/cqlsh -f 
import.cql}}? Because I'm getting the following:
{noformat}
➜  cassandra git:(9303-2.1) ✗ cat input.csv | bin/cqlsh -f import.cql
Using 3 child processes

Starting copy of keyspace1.standard1 with columns ['key', 'C0', 'C1', 'C2', 
'C3', 'C4'].
[Use \. on a line by itself to end input]
Processed: 0 rows; Rate:       0 rows/s; Avg. rate:       0 rows/s
0 rows imported from 0 files in 0.007 seconds (0 skipped).
{noformat}

Thanks, we are really close now! :-)

> Match cassandra-loader options in COPY FROM
> -------------------------------------------
>
>                 Key: CASSANDRA-9303
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9303
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Tools
>            Reporter: Jonathan Ellis
>            Assignee: Stefania
>            Priority: Critical
>             Fix For: 2.1.x
>
>
> https://github.com/brianmhess/cassandra-loader added a bunch of options to 
> handle real world requirements, we should match those.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to