doris icon indicating copy to clipboard operation
doris copied to clipboard

[Bug] NOT LIKE parsing exception

Open Wilson-BT opened this issue 2 years ago • 7 comments

Search before asking

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

Version

doris-2.0.3

What's Wrong?

When I execute this not like SQL, the Query in the parsing plan looks like this, causing the final query to be abnormal. image

What You Expected?

Bug Fix

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

Wilson-BT avatar Dec 29 '23 11:12 Wilson-BT

Can you provide more info to reproduce this issue, like create table statement and query SQL

WinkerDu avatar Dec 29 '23 14:12 WinkerDu

@Wilson-BT Need table schema and query sql information.

yiguolei avatar Dec 30 '23 15:12 yiguolei

@Wilson-BT Need table schema and query sql information.

it`s a jdbc catalog table, table schema:

CREATE TABLE `organization` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `full_name` varchar(150) NULL COMMENT '组织名称',
  `update_time` datetimev2(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `create_time` datetimev2(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间'
) ENGINE=JDBC_EXTERNAL_TABLE;

Sql :

  select *
  from tidb_prod_tikv.ehr_sync.organization 
 where (full_name not like '%虚店%' )and (full_name not like '%直播%')

I think,you can create any jdbc catalog table, and use not like 'xxx' to reproduce this issue.

Wilson-BT avatar Jan 01 '24 02:01 Wilson-BT

I try to create jdbc catalog for external mysql table:

CREATE TABLE `organization` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `full_name` varchar(150) NULL,
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
)

then execute query like:

explain select *
from mysql_jdbc_catalog.drp_db.organization 
 where (full_name not like '%虚店%' )and (full_name not like '%直播%');

I cannot reproduce this issue in Branch-2.0 branch for both Nereids planner and Old planner. Nereids planner: image Old planner: image Maybe you can upgrade your Doris? @Wilson-BT cc @yiguolei

WinkerDu avatar Jan 01 '24 10:01 WinkerDu

I try to create jdbc catalog for external mysql table:

CREATE TABLE `organization` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `full_name` varchar(150) NULL,
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
)

then execute query like:

explain select *
from mysql_jdbc_catalog.drp_db.organization 
 where (full_name not like '%虚店%' )and (full_name not like '%直播%');

I cannot reproduce this issue in Branch-2.0 branch for both Nereids planner and Old planner. Nereids planner: image Old planner: image Maybe you can upgrade your Doris? @Wilson-BT cc @yiguolei

OK. i have Already upgraded.The problem has been solved. Thank you for your attention.

Wilson-BT avatar Jan 02 '24 02:01 Wilson-BT

I try to create jdbc catalog for external mysql table:

CREATE TABLE `organization` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `full_name` varchar(150) NULL,
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
)

then execute query like:

explain select *
from mysql_jdbc_catalog.drp_db.organization 
 where (full_name not like '%虚店%' )and (full_name not like '%直播%');

I cannot reproduce this issue in Branch-2.0 branch for both Nereids planner and Old planner. Nereids planner: image Old planner: image Maybe you can upgrade your Doris? @Wilson-BT cc @yiguolei

I have the same problem.
version: 2.0.3 Is there a bug in the latest version ?

baofengzhouyu avatar Jan 15 '24 02:01 baofengzhouyu

I try to create jdbc catalog for external mysql table:

CREATE TABLE `organization` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `full_name` varchar(150) NULL,
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
)

then execute query like:

explain select *
from mysql_jdbc_catalog.drp_db.organization 
 where (full_name not like '%虚店%' )and (full_name not like '%直播%');

I cannot reproduce this issue in Branch-2.0 branch for both Nereids planner and Old planner. Nereids planner: image Old planner: image Maybe you can upgrade your Doris? @Wilson-BT cc @yiguolei

I have the same problem. version: 2.0.3 Is there a bug in the latest version ?

It may have been fixed in 2.0.4. Just wait and see

Wilson-BT avatar Jan 15 '24 02:01 Wilson-BT