Answers: <p>The only way to do it with cqlsh is wrap binary file into CSV file and run <code>cqlsh --some_args -e 'COPY table_name FROM binary_wrapped.csv'</code>, but in order to do so you have to generate a new primary key to use in CSV-file.</p>
  
  <p>IMO: Since cqlsh is a wrapper around python client, your ops should just write simple python script for this operation, it would be much easier in many ways.</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-09-19T14:07:51.897Z
Answers: 2017-09-19T14:07:51.897Z
Answers: chupasaurus
Body: <p>While the dev team works on a REST service to manage binary data in Cassandra, ops would like to store local blobs directly from shell.</p>
  
  <p>Is it actually possible via CQL/bash without a Cassandra driver? I could find so far only an <a href="https://stackoverflow.com/questions/9056494/how-to-store-binary-data-with-cassandra-cql">example for Ruby</a>.</p>
  
Tags: <shell-script><cassandra>
Title: Cassandra DB: store binary file record via shell
UserDisplayName: Ta Mu
ThreadText: # Cassandra DB: store binary file record via shell
  
  (Asked by: username_0 on 2017-09-19)
  
  While the dev team works on a REST service to manage binary data in Cassandra, ops would like to store local blobs directly from shell.
  
  Is it actually possible via CQL/bash without a Cassandra driver? I could find so far only an [example for Ruby](https://stackoverflow.com/questions/9056494/how-to-store-binary-data-with-cassandra-cql).
  
  **Tags:** shell-script, cassandra
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-09-19. Score: 5 | Accepted answer
  
  The only way to do it with cqlsh is wrap binary file into CSV file and run `cqlsh --some_args -e 'COPY table_name FROM binary_wrapped.csv'`, but in order to do so you have to generate a new primary key to use in CSV-file.
  
  IMO: Since cqlsh is a wrapper around python client, your ops should just write simple python script for this operation, it would be much easier in many ways.
  
  
  ---
  
  