Files
scylladb/test/cql/lua_test.result
Jan Ciolek d2ef55b12c test: use NetworkTopologyStrategy in all unit tests
As described in https://github.com/scylladb/scylladb/issues/8638,
we're moving away from `SimpleStrategy`, in the future
it will become deprecated.

We should remove all uses of it and replace them
with `NetworkTopologyStrategy`.

This change replaces `SimpleStrategy` with
`NetworkTopologyStrategy` in all unit tests,
or at least in the ones where it was reasonable to do so.
Some of the tests were written explicitly to test the
`SimpleStrategy` strategy, or changing the keyspace from
`SimpleStrategy` to `NetworkTopologyStrategy`.
These tests were left intact.
It's still a feature that is supported,
even if it's slowly getting deprecated.

The typical way to use `NetworkTopologyStrategy` is
to specify a replication factor for each datacenter.
This could be a bit cumbersome, we would have to fetch
the list of datacenters, set the repfactors, etc.

Luckily there is another way - we can just specify
a replication factor to use for or each existing
datacenter, like this:
```cql
CREATE KEYSPACE {} WITH REPLICATION =
{'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1};
```

This makes the change rather straightforward - just replace all
instances of `'SimpleStrategy'', with `'NetworkTopologyStrategy'`.

Refs: https://github.com/scylladb/scylladb/issues/8638

Signed-off-by: Jan Ciolek <jan.ciolek@scylladb.com>

Closes #13990
2023-05-23 08:52:56 +03:00

35 lines
1.1 KiB
Plaintext

> -- Error messages contain a keyspace name. Make the output stable.
> CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1};
OK
> -- setup
> create table ks.my_table (key int primary key);
OK
> insert into ks.my_table (key) values (1);
OK
>
> -- test list<varint>
> create function ks.my_func(val int) called on null input returns list<varint> language lua as 'return {1,2,3}';
OK
> select ks.my_func(key) from ks.my_table;
+-------------------+
| ks.my_func(key) |
|-------------------|
| [1, 2, 3] |
+-------------------+
> drop function ks.my_func;
OK
>
> -- test list<decimal>
> create function ks.my_func(val int) called on null input returns list<decimal> language lua as 'return {1,2,3}';
OK
> select ks.my_func(key) from ks.my_table;
+--------------------------------------------+
| ks.my_func(key) |
|--------------------------------------------|
| [Decimal('1'), Decimal('2'), Decimal('3')] |
+--------------------------------------------+
> drop function ks.my_func;
OK
> DROP KEYSPACE ks;
OK