hierarchy with expressions' from Avi Kivity Currently, the grammar has two parallel hierarchies. One hierarchy is used in the WHERE clause, and is based on a combination of `term` and expressions. The other is used in the SELECT clause, and is using the cql3::selection::selectable hierarchy. There is some overlap between the hierarchies: both can name columns. Logically, however, they overlap completely - in SQL anything you can select you can filter on, and vice versa. So merging the two hierarchies is important if we want to enrich CQL. This series does that, partially (see below), converting the SELECT clause to expressions. There is another hierarchy split: between the "raw", pre-prepare object hierarchy, and post-prepare non-raw. This series limits itself to converting the raw hierarchy and leaves the non-raw hierarchy alone. An important design choice is not to have this raw/non-raw split in expressions. Note that most of the hierarchy is completely parallel: addition is addition both before prepare and after prepare (but see [1]). The main difference is around identifiers - before preparation they are unresolved, and after preparation they become `column_definition` objects. We resolve that by having two separate types: `unresolved_identifier` for the pre-prepare phase, and the existing `column_value` for post-prepare phase. Alternative choices would be to keep a separate expression::raw variant, or to template the expression variant on whether it is raw or not. I think it would cause undue bloat and confusion. Note the series introduces many on_internal_error() calls. This is because there is not a lot of overlap in the hierarchies today; you can't have a cast in the WHERE clause, for example. These on_internal_error() calls cannot be triggered since the grammar does not yet allow such expressions to be expressed. As we expand the grammar, they will have to be replaced with working implementations. Lastly, field selection is expressible in both hierarchies. This series does not yet merge the two representations (`column_value.sub` vs `field_selection`), but it should be easy to do so later. [1] the `+` operator can also be translated to list concatenation, which we may choose to represent by yet another type. Test: unit(dev) Closes #9087 * github.com:scylladb/scylla: cql3: expression: update find_atom, count_if for function_call, cast, field_selection cql3: expressions: fix printing of nested expressions cql3: selection: replace selectable::raw with expression cql3: expression: convert selectable::with_field_selection::raw to expression cql3: expression: convert selectable::with_cast::raw to expression cql3: expression: convert selectable::with_anonymous_function::raw to expression cql3: expression: convert selectable::with_function_call::raw to expressions cql3: selectable: make selectable::raw forward-declarable cql3: expressions: convert writetime_or_ttl::raw to expression cql3: expression: add convenience constructor from expression element to nested expression utils: introduce variant_element.hh cql3: expression: use nested_expression in binary_operator cql3: expression: introduce nested_expression class Convert column_identifier_raw's use as selectable to expressions make column_identifier::raw forward declarable cql3: introduce selectable::with_expression::raw
Scylla
What is Scylla?
Scylla is the real-time big data database that is API-compatible with Apache Cassandra and Amazon DynamoDB. Scylla embraces a shared-nothing approach that increases throughput and storage capacity to realize order-of-magnitude performance improvements and reduce hardware costs.
For more information, please see the ScyllaDB web site.
Build Prerequisites
Scylla is fairly fussy about its build environment, requiring very recent versions of the C++20 compiler and of many libraries to build. The document HACKING.md includes detailed information on building and developing Scylla, but to get Scylla building quickly on (almost) any build machine, Scylla offers a frozen toolchain, This is a pre-configured Docker image which includes recent versions of all the required compilers, libraries and build tools. Using the frozen toolchain allows you to avoid changing anything in your build machine to meet Scylla's requirements - you just need to meet the frozen toolchain's prerequisites (mostly, Docker or Podman being available).
Building Scylla
Building Scylla with the frozen toolchain dbuild is as easy as:
$ git submodule update --init --force --recursive
$ ./tools/toolchain/dbuild ./configure.py
$ ./tools/toolchain/dbuild ninja build/release/scylla
For further information, please see:
- Developer documentation for more information on building Scylla.
- Build documentation on how to build Scylla binaries, tests, and packages.
- Docker image build documentation for information on how to build Docker images.
Running Scylla
To start Scylla server, run:
$ ./tools/toolchain/dbuild ./build/release/scylla --workdir tmp --smp 1 --developer-mode 1
This will start a Scylla node with one CPU core allocated to it and data files stored in the tmp directory.
The --developer-mode is needed to disable the various checks Scylla performs at startup to ensure the machine is configured for maximum performance (not relevant on development workstations).
Please note that you need to run Scylla with dbuild if you built it with the frozen toolchain.
For more run options, run:
$ ./tools/toolchain/dbuild ./build/release/scylla --help
Testing
See test.py manual.
Scylla APIs and compatibility
By default, Scylla is compatible with Apache Cassandra and its APIs - CQL and Thrift. There is also support for the API of Amazon DynamoDB™, which needs to be enabled and configured in order to be used. For more information on how to enable the DynamoDB™ API in Scylla, and the current compatibility of this feature as well as Scylla-specific extensions, see Alternator and Getting started with Alternator.
Documentation
Documentation can be found here. Seastar documentation can be found here. User documentation can be found here.
Training
Training material and online courses can be found at Scylla University. The courses are free, self-paced and include hands-on examples. They cover a variety of topics including Scylla data modeling, administration, architecture, basic NoSQL concepts, using drivers for application development, Scylla setup, failover, compactions, multi-datacenters and how Scylla integrates with third-party applications.
Contributing to Scylla
If you want to report a bug or submit a pull request or a patch, please read the contribution guidelines.
If you are a developer working on Scylla, please read the developer guidelines.
Contact
- The users mailing list and Slack channel are for users to discuss configuration, management, and operations of the ScyllaDB open source.
- The developers mailing list is for developers and people interested in following the development of ScyllaDB to discuss technical topics.