////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////
:documentationPath: /pipeline/transforms/
:language: en_US
:description: The Cassandra Output transform writes data to a Cassandra table of an Apache Cassandra cluster using CQL (Cassandra Query Language) version 3.x.

:openvar: ${
:closevar: }

= image:transforms/icons/cassandraout.svg[Cassandra Output transform Icon, role="image-doc-icon"] Cassandra Output

[%noheader,cols="3a,1a", role="table-no-borders" ]
|===
|
== Description

The Cassandra Output transform writes data to a Cassandra table of an Apache Cassandra cluster using CQL (Cassandra Query Language) version 3.x.
|
== Supported Engines
[%noheader,cols="2,1a",frame=none, role="table-supported-engines"]
!===
!Hop Engine! image:check_mark.svg[Supported, 24]
!Spark! image:check_mark.svg[Supported, 24]
!Flink! image:check_mark.svg[Supported, 24]
!Dataflow! image:check_mark.svg[Supported, 24]
!===
|===

== Options

|===
|Option |Description

|Cassandra connection
|Here you specify the name of the connection to use either as a fixed value or as a variable expression.
There are buttons to the right of the input field to hel you manage the metadata.

|Table to write to
|Specify the name of the table to write to.

|Consistency level
|Please see https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html#Writeconsistencylevels[Cassandra Write consistency levels] for a list of possible values.

|Commit batch size
|The number of rows to update at once in each commit

|Batch insert timeout
|Specify the number of milliseconds to wait for a batch to completely insert before splitting into smaller sub-batches.
You must specify a value lower than Socket timeout or leave empty for no timeout.

|Sub batch size
|Specify the sub-batch size (in number of rows) if the batch must be split because Batch insert timeout is reached.

|Insert unlogged batches
|Select if you want to use non-atomic batch writing.
By default, batches are atomic (if any of the batch succeeds, all of it will succeed).
Select this option to remove the atomic restriction.

|Time to live (TTL)
|Specify the amount of time in which to write a column.
If the time expires, that column is deleted.

|Incoming field to use as the key
|Specify which incoming field to use as the key.
You can use to specify the key from the names of incoming transform fields.

|Create table
|Select to create a named table (column family) if one does not already exist.

|Table creation WITH clause
|Specify additions to the table creation `WITH` clause.

|Truncate table
|Select if you want any existing data to be deleted from the named table before inserting incoming rows.

|Update table metadata
|Select if you want to update the table metadata with information on incoming fields not already present.
If this option is not selected, any unknown incoming fields are ignored unless the Insert fields not in column meta data option is selected.

|Insert fields not in column meta data
|Select if want to insert the table metadata in any incoming fields not present, with respect to the default table validator.
This option has no effect if Update table meta data is selected.

|===

