Skip to content

[fix](planner) : Incorrect result of CAST AS CHAR#12957

Closed
lsy3993 wants to merge 7 commits intoapache:masterfrom
lsy3993:lsy_cast_incorrect
Closed

[fix](planner) : Incorrect result of CAST AS CHAR#12957
lsy3993 wants to merge 7 commits intoapache:masterfrom
lsy3993:lsy_cast_incorrect

Conversation

@lsy3993
Copy link
Contributor

@lsy3993 lsy3993 commented Sep 26, 2022

Proposed changes

Issue Number: #3861

Problem summary

when cast string to char(int), fe should judge the length of target char, rather than return whole string

Checklist(Required)

  1. Does it affect the original behavior:
    • Yes
    • No
    • I don't know
  2. Has unit tests been added:
    • Yes
    • No
    • No Need
  3. Has document been added or modified:
    • Yes
    • No
    • No Need
  4. Does it need to update dependencies:
    • Yes
    • No
  5. Are there any changes that cannot be rolled back:
    • Yes (If Yes, please explain WHY)
    • No

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...

@github-actions github-actions bot added the area/planner Issues or PRs related to the query planner label Sep 26, 2022
@lsy3993 lsy3993 changed the title [bug](planner) : Incorrect result of CAST AS CHAR [fix](planner) : Incorrect result of CAST AS CHAR Sep 26, 2022
@BiteTheDDDDt
Copy link
Contributor

We are not doing char type length processing in the execution engine, it seems that this will make us not have consistent performance globally

@lsy3993
Copy link
Contributor Author

lsy3993 commented Sep 26, 2022

This bug fix is only for the case of casting constant string in FE. When the cast statement calculates in BE, we may fix it later

zy-kkk
zy-kkk previously approved these changes Sep 26, 2022
Copy link
Member

@zy-kkk zy-kkk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@lsy3993 lsy3993 closed this by deleting the head repository Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/planner Issues or PRs related to the query planner kind/test reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants