Skip to content

Conversation

@FreeOnePlus
Copy link
Member

@FreeOnePlus FreeOnePlus commented Sep 8, 2022

Proposed changes

Originally, Order By Limit returned a maximum of 65535 rows of data by default during the query, but now many businesses do not apply this limit. It is necessary to add larger data after the query statement to complete the full data query, which is extremely inconvenient, so adjustments have been made.

At the same time, I added the variable DEFAULT_ORDER_BY_LIMIT to the SessionVariable, the default value is -1, if the user does not use the LIMIT keyword or the LIMIT value is a negative integer, the default query return value is Long.MAX_VALUE. If the corresponding maximum query value is set, the number of data items is returned according to the maximum query value or the value followed by the LIMIT keyword.

Issue Number: close #xxx

Problem summary

Describe your changes.

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 8, 2022
newDefaultOrderByLimit = 65535;
if (analyzer.getContext().getSessionVariable().defaultOrderByLimit <= -1) {
newDefaultOrderByLimit = Long.MAX_VALUE;
LOG.warn("The current default Order By Limit number is the maximum value of Long.");
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the warn log

Copy link
Member Author

Choose a reason for hiding this comment

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

has been completed

LOG.warn("The current default Order By Limit number is the maximum value of Long.");
} else {
newDefaultOrderByLimit = analyzer.getContext().getSessionVariable().defaultOrderByLimit;
LOG.warn("The current default Order By Limit number is {}." + newDefaultOrderByLimit);
Copy link
Contributor

Choose a reason for hiding this comment

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

remove warn log

Copy link
Member Author

Choose a reason for hiding this comment

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

has been completed

newDefaultOrderByLimit = Long.MAX_VALUE;
LOG.warn("The current default Order By Limit number is the maximum value of Long.");
} else {
newDefaultOrderByLimit = analyzer.getContext().getSessionVariable().defaultOrderByLimit;
Copy link
Contributor

Choose a reason for hiding this comment

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

you can just call analyzer.getContext().getSessionVariable().defaultOrderByLimit once

Copy link
Member Author

Choose a reason for hiding this comment

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

has been completed


// Default Order By Limit
@VariableMgr.VarAttr(name = DEFAULT_ORDER_BY_LIMIT)
public long defaultOrderByLimit = -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

add document

Copy link
Member Author

Choose a reason for hiding this comment

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

has been completed

@github-actions github-actions bot added the kind/docs Categorizes issue or PR as related to documentation. label Nov 18, 2022
@hello-stephen
Copy link
Contributor

TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 34.72 seconds
load time: 432 seconds
storage size: 17150866967 Bytes
https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20221118043009_clickbench_pr_48491.html

Copy link
Contributor

@morningman morningman 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 github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 18, 2022
@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.

@morningman morningman merged commit f5f2e84 into apache:master Nov 19, 2022
FreeOnePlus added a commit to FreeOnePlus/doris that referenced this pull request Nov 27, 2022
…12478)

Originally, Order By Limit returned a maximum of 65535 rows of data by default during the query,
but now many businesses do not apply this limit.
It is necessary to add larger data after the query statement to complete the full data query,
which is extremely inconvenient, so adjustments have been made.

At the same time, I added the variable DEFAULT_ORDER_BY_LIMIT to the SessionVariable,
the default value is -1, if the user does not use the LIMIT keyword or the LIMIT value is a negative integer,
the default query return value is Long.MAX_VALUE. If the corresponding maximum query value is set,
the number of data items is returned according to the maximum query value or the value followed by the
LIMIT keyword.
@morningman morningman mentioned this pull request Nov 30, 2022
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 kind/behavior-changed kind/docs Categorizes issue or PR as related to documentation. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants