Skip to content

CASSANDRA-21415: Document COPY TO limitation for control characters in text columns#4856

Open
arvindKandpal-ksolves wants to merge 1 commit into
apache:trunkfrom
arvindKandpal-ksolves:CASSANDRA-21381-docs
Open

CASSANDRA-21415: Document COPY TO limitation for control characters in text columns#4856
arvindKandpal-ksolves wants to merge 1 commit into
apache:trunkfrom
arvindKandpal-ksolves:CASSANDRA-21381-docs

Conversation

@arvindKandpal-ksolves
Copy link
Copy Markdown
Contributor

@arvindKandpal-ksolves arvindKandpal-ksolves commented Jun 1, 2026

COPY TO does not support control characters (such as newlines, carriage
returns, or null bytes) in text column values. Any text column containing
these characters will be silently corrupted on round-trip — COPY TO
succeeds and COPY FROM succeeds, but the re-imported values differ from
the originals.

This patch documents that limitation clearly in the COPY TO section of
the cqlsh reference, in accordance with RFC 4180 which defines CSV
TEXTDATA as printable characters only. Users with such data are directed
to sstableloader for data migration instead.

patch by Arvind Kandpal; reviewed by for CASSANDRA-21415

Comment thread doc/modules/cassandra/pages/managing/tools/cqlsh.adoc Outdated
accordance with RFC 4180. Text columns containing control characters
such as newlines (`\n`), carriage returns (`\r`), null bytes (`\x00`),
or other non-printable characters will not round-trip cleanly — values
will be corrupted on re-import via `COPY FROM`. If your data contains
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest: "cannot be reliably exported — values will be corrupted on re-import via COPY FROM"

accordance with RFC 4180. Text columns containing control characters
such as newlines (`\n`), carriage returns (`\r`), null bytes (`\x00`),
or other non-printable characters will not round-trip cleanly — values
will be corrupted on re-import via `COPY FROM`. If your data contains
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be some mention of the security risks of binary data. Suggest this after COPY FROM:

Beyond data integrity, non-printable characters in CSV output can pose security risks,
including CSV injection and other forms of malicious data embedding.

@arvindKandpal-ksolves arvindKandpal-ksolves changed the title CASSANDRA-21381: Document COPY TO limitation for control characters in text columns CASSANDRA-21415: Document COPY TO limitation for control characters in text columns Jun 2, 2026
…n 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 TBD for CASSANDRA-21415
@arvindKandpal-ksolves
Copy link
Copy Markdown
Contributor Author

Hi @bschoening , updated the title and description for the new jira ticket and also update the suggested changes.

@bschoening
Copy link
Copy Markdown
Contributor

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants