GreptimeTeam / greptimedb

An open-source, cloud-native, unified time series database for metrics, logs and events with SQL/PromQL supported. Available on GreptimeCloud.
https://greptime.com/
Apache License 2.0
4.36k stars 315 forks source link

Cannot alter table to set TTL #5026

Closed dekelpilli closed 5 days ago

dekelpilli commented 5 days ago

What type of bug is this?

Unexpected error

What subsystems are affected?

Query Engine

Minimal reproduce step

  1. Create a table
CREATE TABLE IF NOT EXISTS "test" (
  "ts" TIMESTAMP(9) NOT NULL,
  "s" STRING,
  TIME INDEX ("ts"),
  PRIMARY KEY ("s")
);
  1. Attempt to set TTL on table as per docs (https://docs.greptime.com/reference/sql/alter/#alter-table-options)
ALTER TABLE test SET 'ttl'='1d';

What did you expect to see?

Successful execution, causing table to gain TTL

What did you see instead?

{
    "code": 2000,
    "error": "sql parser error: expect keyword ADD or DROP or MODIFY or RENAME after ALTER TABLE, found SET",
    "execution_time_ms": 0
}

What operating system did you use?

Mac OS 15.1

What version of GreptimeDB did you use?

0.9.5

Relevant log output and stack trace

No response

lyang24 commented 5 days ago

Hi, I did not find alter ttl support on 0.9.5's release notes. However, alter ttl feature is already merged in master and will likely be included on the future releases.

dekelpilli commented 5 days ago

I see, so it's just that the docs website shouldn't be showing that option under 0.9 (yet?). Thanks for the quick response.

evenyag commented 5 days ago

We'll release v0.10 soon. The latest nightly release should support this feature: https://github.com/GreptimeTeam/greptimedb/releases/tag/v0.10.0-nightly-20241111

evenyag commented 5 days ago

I see, so it's just that the docs website shouldn't be showing that option under 0.9 (yet?).

Oh, that's unexpected. We should correct the document. Thanks for your report!