Skip to content

Commit 36b23cb

Browse files
arvindKandpal-ksolvesCopilot
authored andcommitted
Document COPY TO limitation for control characters in text columns
COPY TO does not support control characters in text column values per RFC 4180. This patch documents the limitation in the cqlsh reference, including the security risks and alternative tools for data migration. patch by Arvind Kandpal; reviewed by Brad Schoening, Stefan Miklosovic for CASSANDRA-21415 Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 50960a2 commit 36b23cb

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • doc/modules/cassandra/pages/managing/tools

doc/modules/cassandra/pages/managing/tools/cqlsh.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,19 @@ value `STDOUT` (without single quotes) to print the CSV to stdout.
461461
See `shared-copy-options` for options that apply to both `COPY TO` and
462462
`COPY FROM`.
463463

464+
[NOTE]
465+
====
466+
`COPY TO` exports CSV using a restricted RFC 4180-compatible format and does not
467+
preserve control characters in text column values. Text columns containing control characters
468+
such as newlines (`\n`), carriage returns (`\r`), null bytes (`\x00`),
469+
or other non-printable characters cannot be reliably exported — values
470+
will be corrupted on re-import via `COPY FROM`. Beyond data integrity,
471+
non-printable characters in CSV output can pose security risks, including
472+
CSV injection and other forms of malicious data embedding. If your data
473+
contains such characters, consider using DSBulk, Spark, or
474+
`sstableloader` for data migration instead.
475+
====
476+
464477
==== Options for `COPY TO`
465478

466479
`MAXREQUESTS`::

0 commit comments

Comments
 (0)