Incorrect sql statements are generated in mysql

I found that when the IN clause is used in where, and the IN list is too long, dremio will optimize it to INNER JOIN (VALUES…), but MySQL does not support this, resulting in execution errors.

sql: (7.0 KB)

profile: (123.5 KB)

dremio info:

@bigfacewo This is an optimization rule that was developed for IN clauses having > 1500, can you try to disable exec.operator.orfast and retry the query. Do you a similar use case with PARQUET too?

This is the data I use: (403.7 KB)

However, this problem does not exist when querying from the parquet file.

I think this is a good optimization, but the database support is not considered.