apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.31k stars 3.21k forks source link

[Bug] VARIANT doesn't exist in 2.1.1 version #33252

Open emahdij opened 5 months ago

emahdij commented 5 months ago

Search before asking

Version

operator image: selectdb/doris.k8s-operator:1.4.1 Doris images: selectdb/doris.fe-ubuntu:2.1.1 selectdb/doris.be-ubuntu:2.1.1

What's Wrong?

Hi folks I’ve installed Apache Doris in k8s by selectdb operator. When I want to create a table with a VARIANT variable I will get this error:

CREATE TABLE IF NOT EXISTS ${table_name} (
    k BIGINT,
    v VARIANT
)
table_properties;
no viable alternative at input 'VARIANT'(line 1, pos 53)

This is the version that MySQL command tells me:

Server version: 5.7.99 Doris version doris-2.1.1-rc05-9f2520537f

What You Expected?

I expect to create table with VARIANT variable.

How to Reproduce?

This is the

Anything Else?

No response

Are you willing to submit PR?

Code of Conduct

eldenmoon commented 5 months ago

your sql is syntacticly wrong,you should use full sql like :

CREATE DATABASE test_variant;
USE test_variant;
CREATE TABLE IF NOT EXISTS github_events (
    id BIGINT NOT NULL,
    type VARCHAR(30) NULL,
    actor VARIANT NULL,
    repo VARIANT NULL,
    payload VARIANT NULL,
    public BOOLEAN NULL,
    created_at DATETIME NULL,
    INDEX idx_payload (`payload`) USING INVERTED PROPERTIES("parser" = "english") COMMENT 'inverted index for payload'
)
DUPLICATE KEY(`id`)
DISTRIBUTED BY HASH(id) BUCKETS 10
properties("replication_num" = "1");

referer to https://doris.apache.org/docs/sql-manual/sql-reference/Data-Types/VARIANT