-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 up incorrect PARTITIONED BY
error messages
#15961
Conversation
@@ -296,8 +296,6 @@ The string constant can also include any of the keywords mentioned above: | |||
- `ALL TIME` | |||
- `ALL` - Alias for `ALL TIME` | |||
|
|||
The `WEEK` granularity is deprecated and not supported in MSQ. |
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.
This conflicts with the note below, which is more accurate:
*Avoid partitioning by week,
P1W
, because weeks don't align neatly with months and years, making it difficult to partition by coarser granularities later.
@@ -54,13 +54,6 @@ public SqlGranularityLiteral clone(SqlParserPos pos) | |||
return new SqlGranularityLiteral(granularity, unparseString, pos); | |||
} | |||
|
|||
@Override | |||
@Deprecated | |||
public Object clone() |
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.
Thought overriding a deprecated method for the sake of throwing an exception was not really needed.
f6c14fc
to
ba36f88
Compare
ba36f88
to
474e34f
Compare
)) | ||
.expectTarget("dst", targetRowSignature) | ||
.expectResources(dataSourceRead("foo"), dataSourceWrite("dst")) | ||
.expectQuery( |
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.
should we test the expected granularity here too?
Prior to this patch, an incorrect
PARTITIONED BY
clause can expose options likeNONE
in the returned error message:Also, some of these granularities like
SECOND
andMINUTE
are reserved SQL keywords that are not handled explicitly in Druid. In order for them to be properly used they should be quoted as literals. So single quote the granularity literals in the error message making it clear to a user about the correct usage.Other related changes:
DruidSqlParserUtils.java
:@VisibleForTesting
, etc.Key changed/added classes in this PR
DruidSqlParserUtils.java
DruidSqlParserUtilsTest.java
This PR has: