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

Michael Shuler commented on CASSANDRA-8675:
-------------------------------------------

Hi Vincenzo, would you be so kind as to verify the bug still affects trunk/4.x? 
If the behavior does indeed still present itself, edit the bug and adjust the 
fixver from 3.0.x to also include: 3.11., 4.x, 5.x. If it is important to you, 
as it sounds that it is, please bring this up on the cassandra-dev mailing list 
and see if you can find an active committer to review and offer feedback. (I 
would suggest that a patch that also includes test(s) would be an improvement 
to the current patch.)

As it sits, this bug likely won't be seen by other devs outside of the few 
ticket "watchers", which is how I was notified. The squeaky wheel is going to 
get noticed.

> COPY TO/FROM broken for newline characters
> ------------------------------------------
>
>                 Key: CASSANDRA-8675
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8675
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Legacy/Tools
>         Environment: [cqlsh 5.0.1 | Cassandra 2.1.2 | CQL spec 3.2.0 | Native 
> protocol v3]
> Ubuntu 14.04 64-bit
>            Reporter: Lex Lythius
>            Priority: Normal
>              Labels: cqlsh, remove-reopen
>             Fix For: 3.0.x
>
>         Attachments: CASSANDRA-8675.patch, copytest.csv
>
>
> Exporting/importing does not preserve contents when texts containing newline 
> (and possibly other) characters are involved:
> {code:sql}
> cqlsh:test> create table if not exists copytest (id int primary key, t text);
> cqlsh:test> insert into copytest (id, t) values (1, 'This has a newline
>         ... character');
> cqlsh:test> insert into copytest (id, t) values (2, 'This has a quote " 
> character');
> cqlsh:test> insert into copytest (id, t) values (3, 'This has a fake tab \t 
> character (typed backslash, t)');
> cqlsh:test> select * from copytest;
>  id | t
> ----+---------------------------------------------------------
>   1 |                           This has a newline\ncharacter
>   2 |                            This has a quote " character
>   3 | This has a fake tab \t character (entered slash-t text)
> (3 rows)
> cqlsh:test> copy copytest to '/tmp/copytest.csv';
> 3 rows exported in 0.034 seconds.
> cqlsh:test> copy copytest from '/tmp/copytest.csv';
> 3 rows imported in 0.005 seconds.
> cqlsh:test> select * from copytest;
>  id | t
> ----+-------------------------------------------------------
>   1 |                          This has a newlinencharacter
>   2 |                          This has a quote " character
>   3 | This has a fake tab \t character (typed backslash, t)
> (3 rows)
> {code}
> I tried replacing \n in the CSV file with \\n, which just expands to \n in 
> the table; and with an actual newline character, which fails with error since 
> it prematurely terminates the record.
> It seems backslashes are only used to take the following character as a 
> literal
> Until this is fixed, what would be the best way to refactor an old table with 
> a new, incompatible structure maintaining its content and name, since we 
> can't rename tables?



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

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to