Question : You are working with a financial indexing data company, who had recently acquired a real estate company. This real estate Data Company is storing their data in excel and they never had a RDBMS in their organization. You already have Cassandra in your company and you want to put this data which is in excel as a csv or pipe separated. Which of the following command will help you to bring this data in Cassandra? 1. COPY
Correct Answer : Get Lastest Questions and Answer : Explanation: CQL shell commands that import and export CSV (comma-separated values or delimited text files).
COPY TO exports data from a table into a CSV file. Each row is written to a line in the target file with fields separated by the delimiter. All fields are exported when no column names are specified. To drop columns, specify a column list. COPY FROM imports data from a CSV file into an existing table. Each line in the source file is imported as a row. All rows in the dataset must contain the same number of fields and have values in the PRIMARY KEY fields. The process verifies the PRIMARY KEY and updates existing records. If HEADER = false and no column names are specified, the fields are imported in deterministic order. When column names are specified, fields are imported in that order. Missing and empty fields are set to null. The source cannot have more fields than the target table, however it can have fewer fields.
Question : Which all are correct, with regards to defining Cassandra Keyspace?
Correct Answer : Get Lastest Questions and Answer : Explanation: Keyspaces A cluster is a container for keyspacesa"typically a single keyspace. A keyspace is the outermost container for data in Cassandra, corresponding closely to a relational database. Like a relational database, a keyspace has a name and a set of attributes that define keyspace-wide behavior. Although people frequently advise that itas a good idea to create a single keyspace per application, this doesnat appear to have much practical basis. Itas certainly an acceptable practice, but itas perfectly fine to create as many keyspaces as your application needs. Note, however, that you will probably run into trouble creating thousands of keyspaces per application. Depending on your security constraints and partitioner, itas fine to run multiple keyspaces on the same cluster. For example, if your application is called Twitter, you would probably have a cluster called Twitter-Cluster and a keyspace called Twitter. To my knowledge, there are currently no naming conventions in Cassandra for such items. In Cassandra, the basic attributes that you can set per keyspace are: Replication factor In simplest terms, the replication factor refers to the number of nodes that will act as copies (replicas) of each row of data. If your replication factor is 3, then three nodes in the ring will have copies of each row, and this replication is transparent to clients. The replication factor essentially allows you to decide how much you want to pay in performance to gain more consistency. That is, your consistency level for reading and writing data is based on the replication factor. Replica placement strategy The replica placement refers to how the replicas will be placed in the ring. There are different strategies that ship with Cassandra for determining which nodes will get copies of which keys. These are SimpleStrategy (formerly known as RackUnawareStrategy), OldNetworkTopologyStrategy (formerly known as Rack- AwareStrategy), and NetworkTopologyStrategy (formerly known as Datacenter- ShardStrategy). Column families In the same way that a database is a container for tables, a keyspace is a container for a list of one or more column families. A column family is roughly analagous to a table in the relational model, and is a container for a collection of rows. Each row contains ordered columns. Column families represent the structure of your data. Each keyspace has at least one and often many column families.