-
Notifications
You must be signed in to change notification settings - Fork 267
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 some bugs in Doris implementation #853
base: main
Are you sure you want to change the base?
Conversation
To avoid misunderstanding, the original implementation of Doris (#758) is done by me, this is another Github account of mine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for keeping working on the Doris implementation! It would be great to fix the CI tests as well. Could you please look into this if you have time?
src/sqlancer/doris/DorisSchema.java
Outdated
DorisDataType type = DorisDataType.getRandomWithoutNull(); | ||
if (globalState != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any valid case where globalState
can be null
? If not, you can do a check at the beginning of the method and throw an IllegalArgumentException
if it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There shouldn't be null here, I've removed it
src/sqlancer/doris/DorisSchema.java
Outdated
|| type == DorisDataType.DATETIME && globalState.getDbmsSpecificOptions().testDateTimeConstants | ||
|| type == DorisDataType.VARCHAR && globalState.getDbmsSpecificOptions().testStringConstants | ||
) { | ||
typeIsQualified = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what we are checking here. Is it for primitive types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, the user does not want to test the datetime type, so the datetime type should not be generated from the CREATE table
. I have corrected the writing style here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to select from a list of possible options, and throw an exception if no type can be selected. See
List<Expression> possibleOptions = new ArrayList<>(Arrays.asList(Expression.values())); |
src/sqlancer/doris/oracle/tlp/DorisQueryPartitioningAggregateTester.java
Outdated
Show resolved
Hide resolved
Sorry, I don't have enough hardware environment to test this CI. I'll try to find someone in the Doris community to do this. |
cc3d0f0
to
6a9e723
Compare
I have correct the code, can you help me to review again? Thanks. |
I think you could just do this by creating a PR and seeing if the CI passes with your changes? This would work best after merging this PR, since the CI tests are not automatically executed for new contributors. |
dt = Randomly.fromOptions(values()); | ||
} while (dt == DorisDataType.NULL); | ||
return dt; | ||
public static DorisDataType getRandomWithoutNull(DorisOptions options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd actually suggest including all types by default, and removing them when an option is specified. With the current version, if someone adds a new type, they need to debug why it is not generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest that we merge the PR after fixing this, so the CI tests run automatically, making it easier to fix them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest that we merge the PR after fixing this, so the CI tests run automatically, making it easier to fix them.
Yes, I'm working on fixing CI. But I'm only free on weekends, so it might be a bit slow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd actually suggest including all types by default, and removing them when an option is specified. With the current version, if someone adds a new type, they need to debug why it is not generated.
I think this can be divided into two functions, one is to generate all basic types without parameters, and the other is to generate legal types based on options.
I tried this PR and found that no.4 issue(select fields not in group by) still exists, maybe it needs to have a look again. |
Signed-off-by: codenohup <huangxu.walker@gmail.com>
Signed-off-by: codenohup <huangxu.walker@gmail.com>
Signed-off-by: codenohup <huangxu.walker@gmail.com>
Hey, I updated it again, you can try again to see if it works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Can you please fix the redundant important? The CI tests are currently failing because of that. |
here, meet error |
one more,
by when try to reproduce,I got this
Doris seems do not support operator |
Hi all.
Thanks to Sqlancer, I found a lot of logic bugs in Doris, some of them have been fixed by the Doris community.
Now I found some unexpected bugs in the implementation of dors, see below:
CAST(0.19511769711971283 AS NULL)
, cast a value or column to nullCREATE TABLE t0(c0 DATETIME NOT NULL DEFAULT NULL)
, assign the default value NULL to the non-nullable columns in the CREATE TABLE statementSELECT t0.c0 FROM t1, t0 GROUP BY t1.c0
, select fields not in group byThis PR tries to fix them.
Thanks for your review and thanks again for the Sqlancer tool!