diff --git a/doc/Makefile b/doc/Makefile index 43acc1ee7c5d..2eee1146692e 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -12,7 +12,7 @@ # limitations under the License. GENERATE_NODETOOL_DOCS = ./scripts/gen-nodetool-docs.py -MAKE_CASSANDRA_YAML = ./scripts/convert_yaml_to_adoc.py ../conf/cassandra.yaml ./modules/cassandra/pages/configuration/cass_yaml_file.adoc +MAKE_CASSANDRA_YAML = ./scripts/convert_yaml_to_adoc.py ../conf/cassandra.yaml ./modules/cassandra/pages/managing/configuration/cass_yaml_file.adoc .PHONY: html html: @@ -20,7 +20,7 @@ html: .PHONY: gen-asciidoc gen-asciidoc: - @mkdir -p modules/cassandra/pages/tools/nodetool + @mkdir -p modules/cassandra/pages/managing/tools/nodetool @mkdir -p modules/cassandra/examples/TEXT/NODETOOL python3 $(GENERATE_NODETOOL_DOCS) python3 $(MAKE_CASSANDRA_YAML) diff --git a/doc/modules/ROOT/pages/index.adoc b/doc/modules/ROOT/pages/index.adoc index dd6a84a4d856..253347916903 100644 --- a/doc/modules/ROOT/pages/index.adoc +++ b/doc/modules/ROOT/pages/index.adoc @@ -1,14 +1,11 @@ = Welcome to Apache Cassandra's documentation! - :description: Starting page for Apache Cassandra documentation. :keywords: Apache, Cassandra, NoSQL, database :cass-url: http://cassandra.apache.org :cass-contrib-url: https://wiki.apache.org/cassandra/HowToContribute -This is the official documentation for {cass-url}[Apache Cassandra]. -If you would like to contribute to this documentation, you are welcome -to do so by submitting your contribution like any other patch following -{cass-contrib-url}[these instructions]. +This is the official documentation for {cass-url}[Apache Cassandra]. +If you would like to contribute to this documentation, you are welcome to do so by submitting your contribution like any other patch following {cass-contrib-url}[these instructions]. == Main documentation @@ -38,10 +35,10 @@ to do so by submitting your contribution like any other patch following | xref:cassandra:integrating/plugins/index.adoc[Plug-ins] | Third-party plug-ins | xref:master@_:ROOT:native_protocol.adoc[Native Protocols] | Native Cassandra protocol specifications - |=== == Meta information + * xref:master@_:ROOT:bugs.adoc[Reporting bugs] * xref:master@_:ROOT:contactus.adoc[Contact us] * xref:master@_:ROOT:development/index.adoc[Contributing code] diff --git a/doc/modules/cassandra/examples/RESULTS/java_verify.result b/doc/modules/cassandra/examples/RESULTS/java_verify.result index 3ea962560c18..37ab068010bc 100644 --- a/doc/modules/cassandra/examples/RESULTS/java_verify.result +++ b/doc/modules/cassandra/examples/RESULTS/java_verify.result @@ -1,3 +1,3 @@ -openjdk version "1.8.0_222" -OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~16.04.1-b10) -OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode) +openjdk version "11.0.20" 2023-07-18 +OpenJDK Runtime Environment Temurin-11.0.20+8 (build 11.0.20+8) +OpenJDK 64-Bit Server VM Temurin-11.0.20+8 (build 11.0.20+8, mixed mode) \ No newline at end of file diff --git a/doc/modules/cassandra/nav.adoc b/doc/modules/cassandra/nav.adoc index 2b63bcf1a293..48419bbbe24c 100644 --- a/doc/modules/cassandra/nav.adoc +++ b/doc/modules/cassandra/nav.adoc @@ -1,92 +1,94 @@ * Cassandra -** xref:getting-started/index.adoc[Getting Started] -*** xref:installing/installing.adoc[Installing Cassandra] -*** xref:getting-started/configuring.adoc[Configuring Cassandra] -*** xref:getting-started/querying.adoc[Inserting and querying] -*** xref:getting-started/drivers.adoc[Client drivers] -*** xref:getting-started/java11.adoc[Support for Java 11] -*** xref:getting-started/production.adoc[Production recommendations] - -** xref:new/index.adoc[What's new] - -** xref:architecture/index.adoc[Architecture] -*** xref:architecture/overview.adoc[Overview] -*** xref:architecture/dynamo.adoc[Dynamo] -*** xref:architecture/storage-engine.adoc[Storage engine] -*** xref:architecture/guarantees.adoc[Guarantees] -*** xref:architecture/messaging.adoc[Improved internode messaging] -*** xref:architecture/streaming.adoc[Improved streaming] - -** xref:developing:data-modeling/index.adoc[Data modeling] -*** xref:developing:data-modeling/intro.adoc[Introduction] -*** xref:developing:data-modeling/data-modeling_conceptual.adoc[Conceptual data modeling] -*** xref:developing:data-modeling/data-modeling_rdbms.adoc[RDBMS design] -*** xref:developing:data-modeling/data-modeling_queries.adoc[Defining application queries] -*** xref:developing:data-modeling/data-modeling_logical.adoc[Logical data modeling] -*** xref:developing:data-modeling/data-modeling_physical.adoc[Physical data modeling] -*** xref:developing:data-modeling/data-modeling_refining.adoc[Evaluating and refining data models] -*** xref:developing:data-modeling/data-modeling_schema.adoc[Defining database schema] -*** xref:developing:data-modeling/data-modeling_tools.adoc[Cassandra data modeling tools] - -** xref:developing:cql/index.adoc[Cassandra Query Language (CQL)] -*** xref:developing:cql/definitions.adoc[Definitions] -*** xref:developing:cql/types.adoc[Data types] -*** xref:developing:cql/ddl.adoc[Data definition (DDL)] -*** xref:developing:cql/dml.adoc[Data manipulation (DML)] -*** xref:developing:cql/operators.adoc[Operators] -*** xref:developing:cql/indexes.adoc[Secondary indexes] -*** xref:developing:cql/mvs.adoc[Materialized views] -*** xref:developing:cql/functions.adoc[Functions] -*** xref:developing:cql/json.adoc[JSON] -*** xref:developing:cql/security.adoc[Security] -*** xref:developing:cql/triggers.adoc[Triggers] -*** xref:developing:cql/appendices.adoc[Appendices] -*** xref:developing:cql/changes.adoc[Changes] -*** xref:developing:cql/SASI.adoc[SASI] -*** xref:developing:cql/cql_singlefile.adoc[Single file of CQL information] - -** xref:managing:configuration/index.adoc[Configuration] -*** xref:managing:configuration/cass_yaml_file.adoc[cassandra.yaml] -*** xref:managing:configuration/cass_rackdc_file.adoc[cassandra-rackdc.properties] -*** xref:managing:configuration/cass_env_sh_file.adoc[cassandra-env.sh] -*** xref:managing:configuration/cass_topo_file.adoc[cassandra-topologies.properties] -*** xref:managing:configuration/cass_cl_archive_file.adoc[commitlog-archiving.properties] -*** xref:managing:configuration/cass_logback_xml_file.adoc[logback.xml] -*** xref:managing:configuration/cass_jvm_options_file.adoc[jvm-* files] -*** xref:managing:configuration/configuration.adoc[Liberating cassandra.yaml Parameters' Names from Their Units] - -** xref:managing:operating/index.adoc[Operating] -*** xref:managing:operating/snitch.adoc[Snitches] -*** xref:managing:operating/topo_changes.adoc[Topology changes] -*** xref:managing:operating/repair.adoc[Repair] -*** xref:managing:operating/read_repair.adoc[Read repair] -*** xref:managing:operating/hints.adoc[Hints] -*** xref:managing:operating/bloom_filters.adoc[Bloom filters] -*** xref:managing:operating/compression.adoc[Compression] -*** xref:managing:operating/cdc.adoc[Change Data Capture (CDC)] -*** xref:managing:operating/backups.adoc[Backups] -*** xref:managing:operating/bulk_loading.adoc[Bulk loading] -*** xref:managing:operating/metrics.adoc[Metrics] -*** xref:managing:operating/security.adoc[Security] -*** xref:managing:operating/hardware.adoc[Hardware] -*** xref:managing:operating/compaction/index.adoc[Compaction] -*** xref:managing:operating/virtualtables.adoc[Virtual tables] -*** xref:managing:operating/auditlogging.adoc[Audit logging] -*** xref:managing:operating/audit_logging.adoc[Audit logging 2] -*** xref:managing:operating/fqllogging.adoc[Full query logging] -*** xref:managing:operating/transientreplication.adoc[Transient replication] - -** xref:managing:tools/index.adoc[Tools] -*** xref:managing:tools/cqlsh.adoc[cqlsh: the CQL shell] -*** xref:managing:tools/nodetool/nodetool.adoc[nodetool] -*** xref:managing:tools/sstable/index.adoc[SSTable tools] -*** xref:managing:tools/cassandra_stress.adoc[cassandra-stress] - -** xref:troubleshooting/index.adoc[Troubleshooting] -*** xref:troubleshooting/finding_nodes.adoc[Finding misbehaving nodes] -*** xref:troubleshooting/reading_logs.adoc[Reading Cassandra logs] -*** xref:troubleshooting/use_nodetool.adoc[Using nodetool] -*** xref:troubleshooting/use_tools.adoc[Using external tools to deep-dive] +** xref:cassandra:new/index.adoc[] +** xref:cassandra:overview/index.adoc[] +*** xref:cassandra:overview/terminology.adoc[] +*** xref:cassandra:overview/faq/index.adoc[] +** xref:cassandra:getting-started/index.adoc[] +*** xref:cassandra:installing/installing.adoc[] +*** xref:cassandra:getting-started/configuring.adoc[] +*** xref:cassandra:getting-started/querying.adoc[] +*** xref:cassandra:getting-started/drivers.adoc[] +*** xref:cassandra:getting-started/java11.adoc[] +*** xref:cassandra:getting-started/production.adoc[] +** xref:cassandra:architecture/index.adoc[] +*** xref:cassandra:architecture/overview.adoc[] +*** xref:cassandra:architecture/dynamo.adoc[] +*** xref:cassandra:architecture/storage-engine.adoc[] +*** xref:cassandra:architecture/guarantees.adoc[] +*** xref:cassandra:architecture/messaging.adoc[] +*** xref:cassandra:architecture/streaming.adoc[] +** xref:cassandra:installing/installing.adoc[] +** xref:cassandra:developing/index.adoc[] +*** xref:cassandra:developing/data-modeling/index.adoc[] +**** xref:cassandra:developing/data-modeling/intro.adoc[] +**** xref:cassandra:developing/data-modeling/data-modeling_conceptual.adoc[] +**** xref:cassandra:developing/data-modeling/data-modeling_rdbms.adoc[] +**** xref:cassandra:developing/data-modeling/data-modeling_queries.adoc[] +**** xref:cassandra:developing/data-modeling/data-modeling_logical.adoc[] +**** xref:cassandra:developing/data-modeling/data-modeling_physical.adoc[] +**** xref:cassandra:developing/data-modeling/data-modeling_refining.adoc[] +**** xref:cassandra:developing/data-modeling/data-modeling_schema.adoc[] +**** xref:cassandra:developing/data-modeling/data-modeling_tools.adoc[] +*** xref:cassandra:developing/cql/index.adoc[] +**** xref:cassandra:developing/cql/definitions.adoc[] +**** xref:cassandra:developing/cql/types.adoc[] +**** xref:cassandra:developing/cql/ddl.adoc[] +**** xref:cassandra:developing/cql/dml.adoc[] +**** xref:cassandra:developing/cql/operators.adoc[] +**** xref:cassandra:developing/cql/indexes.adoc[] +**** xref:cassandra:developing/cql/mvs.adoc[] +**** xref:cassandra:developing/cql/functions.adoc[] +**** xref:cassandra:developing/cql/json.adoc[] +**** xref:cassandra:developing/cql/security.adoc[] +**** xref:cassandra:developing/cql/triggers.adoc[] +**** xref:cassandra:developing/cql/appendices.adoc[] +**** xref:cassandra:developing/cql/changes.adoc[] +**** xref:cassandra:developing/cql/SASI.adoc[SASI] +**** xref:cassandra:developing/cql/cql_singlefile.adoc[] +** xref:cassandra:integrating/plugins/index.adoc[Plug-ins] +** xref:cassandra:managing/index.adoc[] +*** xref:cassandra:managing/configuration/index.adoc[] +**** xref:cassandra:managing/configuration/cass_yaml_file.adoc[] +**** xref:cassandra:managing/configuration/cass_rackdc_file.adoc[] +**** xref:cassandra:managing/configuration/cass_env_sh_file.adoc[] +**** xref:cassandra:managing/configuration/cass_topo_file.adoc[] +**** xref:cassandra:managing/configuration/cass_cl_archive_file.adoc[] +**** xref:cassandra:managing/configuration/cass_logback_xml_file.adoc[] +**** xref:cassandra:managing/configuration/cass_jvm_options_file.adoc[] +**** xref:cassandra:managing/configuration/configuration.adoc[] +*** xref:cassandra:managing/operating/index.adoc[] +**** xref:cassandra:managing/operating/snitch.adoc[] +**** xref:cassandra:managing/operating/topo_changes.adoc[] +**** xref:cassandra:managing/operating/repair.adoc[] +**** xref:cassandra:managing/operating/read_repair.adoc[] +**** xref:cassandra:managing/operating/hints.adoc[] +**** xref:cassandra:managing/operating/bloom_filters.adoc[] +**** xref:cassandra:managing/operating/compression.adoc[] +**** xref:cassandra:managing/operating/cdc.adoc[] +**** xref:cassandra:managing/operating/backups.adoc[] +**** xref:cassandra:managing/operating/bulk_loading.adoc[] +**** xref:cassandra:managing/operating/metrics.adoc[] +**** xref:cassandra:managing/operating/security.adoc[] +**** xref:cassandra:managing/operating/hardware.adoc[] +**** xref:cassandra:managing/operating/compaction/index.adoc[] +**** xref:cassandra:managing/operating/virtualtables.adoc[] +**** xref:cassandra:managing/operating/auditlogging.adoc[] +**** xref:cassandra:managing/operating/audit_logging.adoc[] +**** xref:cassandra:managing/operating/fqllogging.adoc[] +**** xref:cassandra:managing/operating/transientreplication.adoc[] +*** xref:cassandra:managing/tools/index.adoc[] +**** xref:cassandra:managing/tools/cqlsh.adoc[] +**** xref:cassandra:managing/tools/nodetool/nodetool.adoc[] +**** xref:cassandra:managing/tools/sstable/index.adoc[] +** xref:cassandra:tooling/index.adoc[] +*** xref:cassandra:tooling/hash-password.adoc[] +*** xref:cassandra:tooling/generate-tokens.adoc[] +*** xref:cassandra:tooling/cassandra-stress.adoc[] +** xref:cassandra:troubleshooting/index.adoc[] +*** xref:cassandra:troubleshooting/finding_nodes.adoc[] +*** xref:cassandra:troubleshooting/reading_logs.adoc[] +*** xref:cassandra:troubleshooting/use_nodetool.adoc[] +*** xref:cassandra:troubleshooting/use_tools.adoc[] ** xref:master@_:ROOT:development/index.adoc[Development] *** xref:master@_:ROOT:development/gettingstarted.adoc[Getting started] @@ -99,9 +101,4 @@ *** xref:master@_:ROOT:development/documentation.adoc[Working on documentation] *** xref:master@_:ROOT:development/ci.adoc[Jenkins CI environment] *** xref:master@_:ROOT:development/dependencies.adoc[Dependency management] -*** xref:master@_:ROOT:development/release_process.adoc[Release process] - -** xref:overview:faq/index.adoc[FAQ] - -** xref:integrating:plugins/index.adoc[Plug-ins] - +*** xref:master@_:ROOT:development/release_process.adoc[Release process] \ No newline at end of file diff --git a/doc/modules/cassandra/pages/architecture/dynamo.adoc b/doc/modules/cassandra/pages/architecture/dynamo.adoc index aa1cf5aa47e1..551d5a33388c 100644 --- a/doc/modules/cassandra/pages/architecture/dynamo.adoc +++ b/doc/modules/cassandra/pages/architecture/dynamo.adoc @@ -41,7 +41,7 @@ clocks were used to reconcile concurrent updates to a key, Cassandra uses a simpler last-write-wins model where every mutation is timestamped (including deletes) and then the latest version of data is the "winning" value. Formally speaking, Cassandra uses a Last-Write-Wins Element-Set -conflict-free replicated data type for each CQL row, or +conflict-free replicated data type for each CQL row, or https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type#LWW-Element-Set_(Last-Write-Wins-Element-Set)[LWW-Element-Set CRDT], to resolve conflicting mutations on replica sets. @@ -187,7 +187,7 @@ clusters where you do not yet know the datacenter layout of the cluster. [[network-topology-strategy]] ==== `NetworkTopologyStrategy` -`NetworkTopologyStrategy` requires a specified replication factor +`NetworkTopologyStrategy` requires a specified replication factor for each datacenter in the cluster. Even if your cluster only uses a single datacenter, `NetworkTopologyStrategy` is recommended over `SimpleStrategy` to make it easier to add new physical or virtual @@ -429,7 +429,6 @@ seed nodes, often one for each rack or datacenter. Seed nodes are often chosen using existing off-the-shelf service discovery mechanisms. [NOTE] -.Note ==== Nodes do not have to agree on the seed nodes, and indeed once a cluster is bootstrapped, newly launched nodes can be configured to use any @@ -462,7 +461,6 @@ will try to reach out and connect, and if it can open communication channels it will mark that node as available. [NOTE] -.Note ==== `UP` and `DOWN` state are local node decisions and are not propagated with gossip. Heartbeat state is propagated with gossip, but nodes will not diff --git a/doc/modules/cassandra/pages/architecture/guarantees.adoc b/doc/modules/cassandra/pages/architecture/guarantees.adoc index a5f09b97bbba..8f751e1f06fa 100644 --- a/doc/modules/cassandra/pages/architecture/guarantees.adoc +++ b/doc/modules/cassandra/pages/architecture/guarantees.adoc @@ -29,10 +29,9 @@ inherent risk of partition failure, one has to choose between consistency and availability and both cannot be guaranteed at the same time. CAP theorem is illustrated in Figure 1. +.CAP Theorem image::Figure_1_guarantees.jpg[image] -Figure 1. CAP Theorem - High availability is a priority in web-based applications and to this objective Cassandra chooses Availability and Partition Tolerance from the CAP guarantees, compromising on data Consistency to some extent. diff --git a/doc/modules/cassandra/pages/architecture/overview.adoc b/doc/modules/cassandra/pages/architecture/overview.adoc index 2c86ce4c2b7a..92536c130409 100644 --- a/doc/modules/cassandra/pages/architecture/overview.adoc +++ b/doc/modules/cassandra/pages/architecture/overview.adoc @@ -38,18 +38,18 @@ following design objectives: == Features -Cassandra provides the Cassandra Query Language (xref:cql/ddl.adoc[CQL]), an SQL-like +Cassandra provides the Cassandra Query Language (xref:cassandra:developing/cql/ddl.adoc[CQL]), an SQL-like language, to create and update database schema and access data. CQL allows users to organize data within a cluster of Cassandra nodes using: -* *Keyspace*: Defines how a dataset is replicated, per datacenter. +* *Keyspace*: Defines how a dataset is replicated, per datacenter. Replication is the number of copies saved per cluster. Keyspaces contain tables. * *Table*: Defines the typed schema for a collection of partitions. Tables contain partitions, which contain rows, which contain columns. -Cassandra tables can flexibly add new columns to tables with zero downtime. +Cassandra tables can flexibly add new columns to tables with zero downtime. * *Partition*: Defines the mandatory part of the primary key all rows in -Cassandra must have to identify the node in a cluster where the row is stored. +Cassandra must have to identify the node in a cluster where the row is stored. All performant queries supply the partition key in the query. * *Row*: Contains a collection of columns identified by a unique primary key made up of the partition key and optionally additional clustering diff --git a/doc/modules/cassandra/pages/architecture/storage-engine.adoc b/doc/modules/cassandra/pages/architecture/storage-engine.adoc index 6ec448396f30..10b9c7ca7846 100644 --- a/doc/modules/cassandra/pages/architecture/storage-engine.adoc +++ b/doc/modules/cassandra/pages/architecture/storage-engine.adoc @@ -28,7 +28,6 @@ granularity of archiving; 8 or 16 MiB is reasonable. `max_mutation_size` is a half the size of `commitlog_segment_size`. [NOTE] -.Note ==== If `max_mutation_size` is set explicitly then `commitlog_segment_size` must be set to at least twice the size of @@ -49,7 +48,6 @@ _Default Value:_ 10000ms _Default Value:_ batch [NOTE] -.Note ==== In the event of an unexpected shutdown, Cassandra can lose up to the sync period or more if the sync is delayed. If using "batch" @@ -218,5 +216,5 @@ match the "ib" SSTable version [source,bash] ---- -include::example$BASH/find_sstables.sh[] +include::cassandra:example$BASH/find_sstables.sh[] ---- diff --git a/doc/modules/cassandra/pages/architecture/streaming.adoc b/doc/modules/cassandra/pages/architecture/streaming.adoc index 8495ccf0319d..1758f66abb65 100644 --- a/doc/modules/cassandra/pages/architecture/streaming.adoc +++ b/doc/modules/cassandra/pages/architecture/streaming.adoc @@ -190,7 +190,7 @@ This will increase the performance of bootstrapping a node and will also put less pressure on nodes serving the data. This does not affect if N < 3 in each DC as then it streams data from only 2 nodes. -Stream Operation Types ^^^^^^^^^^^^^ +=== Stream Operation Types It is important to know the type or purpose of a certain stream. Version 4.0 diff --git a/doc/modules/cassandra/pages/developing/cql/cql_singlefile.adoc b/doc/modules/cassandra/pages/developing/cql/cql_singlefile.adoc index 286a9923c29d..24c8b89f3a44 100644 --- a/doc/modules/cassandra/pages/developing/cql/cql_singlefile.adoc +++ b/doc/modules/cassandra/pages/developing/cql/cql_singlefile.adoc @@ -1,10 +1,10 @@ -== Cassandra Query Language (CQL) v3.4.3 += Cassandra Query Language (CQL) v3.4.3 \{toc:maxLevel=3} -=== CQL Syntax +== CQL Syntax -==== Preamble +=== Preamble This document describes the Cassandra Query Language (CQL) version 3. CQL v3 is not backward compatible with CQL v2 and differs from it in @@ -19,7 +19,7 @@ definition than they have in SQL. But please note that as such, they do *not* refer to the concept of rows and columns found in the internal implementation of Cassandra and in the thrift and CQL v2 API. -==== Conventions +=== Conventions To aid in specifying the CQL syntax, we will use the following conventions in this document: @@ -49,7 +49,7 @@ bc(sample). SELECT sample_usage FROM cql; shown in a `fixed-width font`. [[identifiers]] -==== Identifiers and keywords +=== Identifiers and keywords The CQL language uses _identifiers_ (or _names_) to identify tables, columns and other objects. An identifier is a token matching the regular @@ -90,7 +90,7 @@ identifiers, it is strongly advised to avoid any name enclosed by squared brackets (like `"[applied]"`) and any name that looks like a function call (like `"f(x)"`). -==== Constants +=== Constants CQL defines the following kind of _constants_: strings, integers, floats, booleans, uuids and blobs: @@ -122,17 +122,17 @@ CQL support. Terms are defined by: [source, bnf] ---- -include::example$BNF/term.bnf[] +include::cassandra:example$BNF/term.bnf[] ---- A term is thus one of: -* A xref:cql/defintions.adoc#constants[constant] -* A literal for either a xref:cql/types.adoc#collections[collection], a xref:cql/types.adoc#vectors[vector], -a xref:cql/types.adoc#udts[user-defined type] or a xref:cql/types.adoc#tuples[tuple] -* A xref:cql/functions.adoc#cql-functions[function] call, either a xref:cql/functions.adoc#scalar-native-functions[native function] -or a xref:cql/functions.adoc#user-defined-scalar-functions[user-defined function] -* An xref:cql/operators.adoc#arithmetic_operators[arithmetic operation] between terms +* A xref:cassandra:developing/cql/defintions.adoc#constants[constant] +* A literal for either a xref:cassandra:developing/cql/types.adoc#collections[collection], a xref:cassandra:developing/cql/types.adoc#vectors[vector], +a xref:cassandra:developing/cql/types.adoc#udts[user-defined type] or a xref:cassandra:developing/cql/types.adoc#tuples[tuple] +* A xref:cassandra:developing/cql/functions.adoc#cql-functions[function] call, either a xref:cassandra:developing/cql/functions.adoc#scalar-native-functions[native function] +or a xref:cassandra:developing/cql/functions.adoc#user-defined-scalar-functions[user-defined function] +* An xref:cassandra:developing/cql/operators.adoc#arithmetic_operators[arithmetic operation] between terms * A type hint * A bind marker, which denotes a variable to be bound at execution time. See the section on `prepared-statements` for details. A bind marker can @@ -140,7 +140,7 @@ be either anonymous (`?`) or named (`:some_name`). The latter form provides a more convenient way to refer to the variable for binding it and should generally be preferred. -==== Comments +=== Comments A comment in CQL is a line beginning by either double dashes (`--`) or double slash (`//`). @@ -154,7 +154,7 @@ bc(sample). + /* This is + a multi-line comment */ -==== Statements +=== Statements CQL consists of statements. As in SQL, these statements can be divided in 3 categories: @@ -245,7 +245,7 @@ $$double-dollar string can contain single ’ quotes$$ + p. [[preparedStatement]] -==== Prepared Statement +=== Prepared Statement CQL supports _prepared statements_. Prepared statement is an optimization that allows to parse a query only once but execute it @@ -265,10 +265,10 @@ bind markers are used, the names for the query parameters will be `[limit]`, `[timestamp]`, and `[ttl]`, respectively. [[dataDefinition]] -=== Data Definition +== Data Definition [[createKeyspaceStmt]] -==== CREATE KEYSPACE +=== CREATE KEYSPACE _Syntax:_ @@ -326,7 +326,7 @@ unless the `IF NOT EXISTS` option is used. If it is used, the statement will be a no-op if the keyspace already exists. [[useStmt]] -==== USE +=== USE _Syntax:_ @@ -343,7 +343,7 @@ selected keyspace, unless link:#statements[otherwise specified], until another USE statement is issued or the connection terminates. [[alterKeyspaceStmt]] -==== ALTER KEYSPACE +=== ALTER KEYSPACE _Syntax:_ @@ -362,7 +362,7 @@ keyspace. The supported `` are the same as for the link:#createKeyspaceStmt[`CREATE KEYSPACE`] statement. [[dropKeyspaceStmt]] -==== DROP KEYSPACE +=== DROP KEYSPACE _Syntax:_ @@ -380,7 +380,7 @@ If the keyspace does not exists, the statement will return an error, unless `IF EXISTS` is used in which case the operation is a no-op. [[createTableStmt]] -==== CREATE TABLE +=== CREATE TABLE _Syntax:_ @@ -431,7 +431,7 @@ unless the `IF NOT EXISTS` option is used. If it is used, the statement will be a no-op if the table already exists. [[createTableName]] -===== `` +==== `` Valid table names are the same as valid link:#createKeyspaceStmt[keyspace names] (up to 32 characters long @@ -442,7 +442,7 @@ link:#statements[``] grammar), it is created in the specified keyspace (but does *not* change the current keyspace). [[createTableColumn]] -===== `` +==== `` A `CREATE TABLE` statement defines the columns that rows of the table can have. A _column_ is defined by its name (an identifier) and its type @@ -474,7 +474,7 @@ PRIMARY KEY (k) + ) [[createTablepartitionClustering]] -===== Partition key and clustering columns +==== Partition key and clustering columns In CQL, the order in which columns are defined for the `PRIMARY KEY` matters. The first column of the key is called the _partition key_. It @@ -493,7 +493,7 @@ making the retrieval of rows in that clustering order particularly efficient (see `SELECT`). [[createTableStatic]] -===== `STATIC` columns +==== `STATIC` columns Some columns can be declared as `STATIC` in a table definition. A column that is static will be ``shared'' by all the rows belonging to the same @@ -527,7 +527,7 @@ so every column is inherently static). * only non `PRIMARY KEY` columns can be static [[createTableOptions]] -===== `