ydb-platform / ydb

YDB is an open source Distributed SQL Database that combines high availability and scalability with strong consistency and ACID transactions
https://ydb.tech
Apache License 2.0
3.83k stars 532 forks source link

Can't use 'SET' in ALTER TABLE or 'WITH' in CREATE TABLE #22

Open Lt-Flash opened 2 years ago

Lt-Flash commented 2 years ago

Hi, I've deployed a test cluster as per documentation, consisting of 3 nodes and 3 hdds each. 3 static nodes and 3 dynamic nodes to serve a test DB. Now, according to manual I should be able to create a table like this:

CREATE TABLE my_table (
    id Uint64,
    title Utf8,
    PRIMARY KEY (id)
)
WITH (
    AUTO_PARTITIONING_BY_SIZE = ENABLED,
    AUTO_PARTITIONING_PARTITION_SIZE_MB = 512
);

To set AUTO_PARTITIONING values, or be able to modify existing table this way:

ALTER TABLE series SET (AUTO_PARTITIONING_BY_SIZE = DISABLED);

Neither of these two examples are working, when I try to run ALTER query I'm getting 'Unexpected token SET: cannot match to any predicted input.

When I'm trying to create the table, I'm getting: Unexpected token 'WITH' : syntax error...

What's the correct syntax to use? The only way to change these parameters I found was to dump the table scheme, update parameters manually in the dump file and load them back into DB.

Thanks.

fireharp commented 2 years ago

@Lt-Flash were you able to create initial storage? I'm stuck on this step (on both local minikube or GKE) https://github.com/ydb-platform/ydb/issues/23

Lt-Flash commented 2 years ago

@demoalex Yes, I was able to create it but I was doing it manually on 3 VMs using this guide:

https://ydb.tech/ru/docs/deploy/manual/deploy-ydb-on-premises

systemd scripts on this page contain some errors, for example:

  1. They never mentioned that you actually need DNS server resolving your nodes, /etc/hosts was not sufficient for me
  2. Next:
    ExecStart=LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ydb/lib ; /opt/ydb/bin/ydbd server --grpc-port 2136 --ic-port 19002 --mon-port 8766 --yaml-config  /opt/ydb/cfg/config.yaml --tenant /Root/testdb --node-broker --node-broker --node-broker

    Actually here you need to list your nodes under '--node-broker', like '--node-broker node1.local --node-broker node2.local --node-broker node3.local'

And some other things were incorrect so it took me a while before I was able to create my cluster and start a test DB in it.

Lt-Flash commented 2 years ago

I also used mirror-3dc configuration and just pretended that my cluster is in three different racks. Also I changed storage type from SSD to ROT everywhere.