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

[Fix](planner)fix targetTypeDef NPE when value is null #18072

Merged
merged 3 commits into from
Mar 27, 2023

Conversation

sohardforaname
Copy link
Contributor

@sohardforaname sohardforaname commented Mar 23, 2023

Proposed changes

Issue Number: close #xxx

Problem summary

sql like:
select * from (select *, null as top from v1)t where top = 5;
select * from (select *, null as top from v1)t where top is not null;
will cause NPE because targetTypeDef is null when value is null. Now we use cast target type to the targetTypeDef.

Checklist(Required)

  • Does it affect the original behavior
  • Has unit tests been added
  • Has document been added or modified
  • Does it need to update dependencies
  • Is this PR support rollback (If NO, please explain WHY)

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@sohardforaname
Copy link
Contributor Author

run buildall

@github-actions github-actions bot added area/planner Issues or PRs related to the query planner kind/test labels Mar 23, 2023
@morningman morningman added usercase Important user case type label dev/1.2.3 labels Mar 24, 2023
@sohardforaname
Copy link
Contributor Author

run p0

@sohardforaname
Copy link
Contributor Author

run buildall

@sohardforaname
Copy link
Contributor Author

run p0

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 27, 2023
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@morrySnow morrySnow merged commit 902629a into apache:master Mar 27, 2023
morningman pushed a commit that referenced this pull request Mar 28, 2023
sql like:
select * from (select *, null as top from v1)t where top = 5;
select * from (select *, null as top from v1)t where top is not null;
will cause NPE because targetTypeDef is null when value is null. Now we use cast target type to the targetTypeDef.
gnehil pushed a commit to gnehil/doris that referenced this pull request Apr 21, 2023
sql like:
select * from (select *, null as top from v1)t where top = 5;
select * from (select *, null as top from v1)t where top is not null;
will cause NPE because targetTypeDef is null when value is null. Now we use cast target type to the targetTypeDef.
mongo360 pushed a commit to mongo360/doris that referenced this pull request Jul 12, 2023
sql like:
select * from (select *, null as top from v1)t where top = 5;
select * from (select *, null as top from v1)t where top is not null;
will cause NPE because targetTypeDef is null when value is null. Now we use cast target type to the targetTypeDef.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. area/planner Issues or PRs related to the query planner dev/1.2.4-merged kind/test reviewed usercase Important user case type label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants