clickhouse-java icon indicating copy to clipboard operation
clickhouse-java copied to clipboard

Create table with keyword "use_metadata_cache"

Open fiend19961 opened this issue 3 years ago • 1 comments

https://github.com/ClickHouse/ClickHouse/pull/32928 jdbc not support this keyword "use_metadata_cache" create table sql:

CREATE TABLE IF NOT EXISTS default.xxx
(
	`timestamp`                     DateTime64(9,'UTC'),
	`xxx`				UInt64
)
ENGINE = MergeTree
PARTITION BY toYYYYMMDD(timestamp)
ORDER BY (timestamp)
SETTINGS use_metadata_cache = true;

warn log

10:00:04.965 [xxx-thread-0] [] WARN  c.c.j.p.ClickHouseSqlParser [140] - Parse error at line 13, column 43.  Encountered: true. If you believe the SQL is valid, please feel free to open an issue on Github with this warning and the following SQL attached.

ClickhouseSqlParser.java warning code

 try {
                stmts = p.sql();
            } catch (Exception var6) {
                log.warn("%s. If you believe the SQL is valid, please feel free to open an issue on Github with this warning and the following SQL attached.\n%s", new Object[]{var6.getMessage(), sql});
            }

fiend19961 avatar Aug 26 '22 07:08 fiend19961

Thanks for the report. It's again a parsing issue. The parser will be moved to a new module clickhouse-sql-parser, and I'll rewrite it using JavaCC 21.

zhicwu avatar Aug 26 '22 08:08 zhicwu