Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Unable to detect syntax issues #45611

Open
3 tasks done
dtkavin opened this issue Dec 18, 2024 · 0 comments
Open
3 tasks done

[Bug] Unable to detect syntax issues #45611

dtkavin opened this issue Dec 18, 2024 · 0 comments

Comments

@dtkavin
Copy link
Contributor

dtkavin commented Dec 18, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Version

2.1

What's Wrong?

Doris did not detect any syntax issues and fallback to old planner when I used the new nereids_planner.

What You Expected?

when using nereids planner ,it returns syntax error messages instead of falling back to old planner.

How to Reproduce?

Reproduce steps:

  1. create table :
    CREATE TABLE `table_a` (
      `event_date` int NULL DEFAULT "0" ,
      `sub_channel_id` int NULL DEFAULT "0" ,
      `channel_id` int NULL DEFAULT "0" ,
      `event_week` int NULL DEFAULT "0" ,
      `event_month` int NULL DEFAULT "0" ,
      INDEX event_date (`event_date`) USING INVERTED,
      INDEX event_week (`event_week`) USING INVERTED,
      INDEX event_month (`event_month`) USING INVERTED
    ) ENGINE=OLAP
    UNIQUE KEY(`event_date`, `sub_channel_id`)
    PARTITION BY RANGE(`event_date`)
    (PARTITION p_min VALUES [("-2147483648"), ("20220500")),
    PARTITION p_202206 VALUES [("20220500"), ("20220600")),
    PARTITION p_202207 VALUES [("20220600"), ("20220700")),
    PARTITION p_max VALUES [("20220700"), (MAXVALUE)))
    DISTRIBUTED BY HASH(`sub_channel_id`) BUCKETS 6
    PROPERTIES (
    "replication_allocation" = "tag.location.default: 3",
    "min_load_replica_num" = "-1",
    "is_being_synced" = "false",
    "storage_medium" = "hdd",
    "storage_format" = "V2",
    "inverted_index_storage_format" = "V1",
    "enable_unique_key_merge_on_write" = "true",
    "light_schema_change" = "true",
    "disable_auto_compaction" = "false",
    "enable_single_replica_compaction" = "false",
    "group_commit_interval_ms" = "10000",
    "group_commit_data_bytes" = "134217728",
    "enable_mow_light_delete" = "false"
    );
    
    CREATE TABLE `table_b` (
      `id` bigint NULL,
      `event_date` int NULL COMMENT '登录日期',
      `event_time` int NULL COMMENT '登录时间,时间戳',
      `channel_id` int NULL COMMENT '渠道ID',
      INDEX channel (`channel_id`) USING INVERTED,
      INDEX event_date (`event_date`) USING INVERTED
    ) ENGINE=OLAP
    UNIQUE KEY(`id`, `event_date`)
    PARTITION BY RANGE(`event_date`)
    (PARTITION p_min VALUES [("-2147483648"), ("20220500")),
    PARTITION p_202206 VALUES [("20220500"), ("20220600")),
    PARTITION p_202207 VALUES [("20220600"), ("20220700")),
    PARTITION p_max VALUES [("20220700"), (MAXVALUE)))
    DISTRIBUTED BY HASH(`event_date`) BUCKETS 6
    PROPERTIES (
    "replication_allocation" = "tag.location.default: 3",
    "min_load_replica_num" = "-1",
    "is_being_synced" = "false",
    "storage_medium" = "hdd",
    "storage_format" = "V2",
    "inverted_index_storage_format" = "V1",
    "enable_unique_key_merge_on_write" = "true",
    "light_schema_change" = "true",
    "disable_auto_compaction" = "false",
    "enable_single_replica_compaction" = "false",
    "group_commit_interval_ms" = "10000",
    "group_commit_data_bytes" = "134217728",
    "enable_mow_light_delete" = "false"
    );
    
  2. it fallback to old planner when we explain SQL
    explain select b.channel_id from table_a as b left join (select c.channel_id from table_b )c  on c.channel_id \nLIMIT 0, 200
    
  3. doris returns syntax error messages when we set enable_fallback_to_original_planner = false
    MySQL [testdb]> explain select b.channel_id from table_a as b left join (select c.channel_id from table_b )c  on c.channel_id \nLIMIT 0, 200;
    PAGER set to stdout
    ERROR 1105 (HY000): errCode = 2, detailMessage = Unknown column 'channel_id' in 'c' in PROJECT clause
    

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant