dolthub / dolt

Dolt – Git for Data
Apache License 2.0
17.41k stars 490 forks source link

Parse SECONDARY_ENGINE parameter in queries #6632

Closed nicktobey closed 10 months ago

nicktobey commented 10 months ago

SECONDARY_ENGINE is a parameter than can appear on CREATE_TABLE and ALTER_TABLE statements.

The value used is stored and can be read with SHOW CREATE TABLE, and unset by setting it to NULL

Examples:

> ALTER TABLE orders SECONDARY_ENGINE RAPID;
> SHOW CREATE TABLE orders;

CREATE TABLE `orders` (
  `O_ORDERKEY` int NOT NULL,
  PRIMARY KEY (`O_ORDERKEY`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin SECONDARY_ENGINE=RAPID

The purpose of the parameter in MySQL is to influence which execution engine is used with this table. It should not have any impact on the expected output of queries. Thus, we can safely ignore it.

However, of the 4859 tests in sqllogictest that are still failing on dolt, 1073 are failing because we don't parse SECONDARY_ENGINE.

It looks like Vitess does SECONDARY_ENGINE in its grammar, so I'm not sure why it's not getting parsed.

timsehn commented 10 months ago

This would be great to parse, keep on the table, and ignore.

jycor commented 10 months ago

Our parser has been updated to fix this issue. However, like most table options, we just parse and ignore, we do not keep these on the table.