Prepare efficiently for the Cassandra Test. Study with comprehensive quizzes and real-world scenarios. Test your understanding with multiple-choice questions and detailed explanations. Get ready for a successful exam!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which command is used to copy data from a CSV file into a table in Cassandra?

  1. Load table From 'path/table.csv';

  2. Copy From table 'path/table.csv';

  3. Copy table(col1, col2, col3) From 'path/table.csv';

  4. Import csv to table1;

The correct answer is: Copy table(col1, col2, col3) From 'path/table.csv';

The command used to copy data from a CSV file into a table in Cassandra is designed to specify both the target table and the columns to which the data will be imported. By using a syntax like "Copy table(col1, col2, col3) From 'path/table.csv';", it clearly indicates that you are specifying the particular columns from the CSV file that correspond to the columns in the table. This level of specificity ensures that the data is being mapped correctly, preventing potential mismatches between the CSV data and the Cassandra table structure. In contrast, other options presented may lack the required syntax or structure necessary for successful data import. For instance, a command that simply states "Load table From 'path/table.csv';" does not conform to the necessary syntax expected in Cassandra for this operation. Furthermore, using "Copy From table 'path/table.csv';" does not correctly fit the required format for copying data. Lastly, the phrase "Import csv to table1;" is too vague and does not match the standard commands recognized by Cassandra for importing data from CSV files. Therefore, option C is the correct choice as it aligns with Cassandra's command structure for importing data, ensuring that the user can efficiently load specific data into the appropriate columns of the