[
https://issues.apache.org/jira/browse/DRILL-7479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16994328#comment-16994328
]
ASF GitHub Bot commented on DRILL-7479:
---------------------------------------
paul-rogers commented on pull request #1923: DRILL-7479: Partial fixes for
metadata parameterized type issues
URL: https://github.com/apache/drill/pull/1923#discussion_r356992397
##########
File path:
metastore/metastore-api/src/main/java/org/apache/drill/metastore/util/TableMetadataUtils.java
##########
@@ -46,21 +46,24 @@
* @param type type of the column
* @return {@link Comparator} instance
*/
- public static Comparator getComparator(TypeProtos.MinorType type) {
+ @SuppressWarnings("unchecked")
+ public static <T> Comparator<T> getComparator(TypeProtos.MinorType type) {
switch (type) {
case INTERVALDAY:
case INTERVAL:
case INTERVALYEAR:
- return
Comparator.nullsFirst(UnsignedBytes.lexicographicalComparator());
+ return (Comparator<T>) (Comparator<?>)
Review comment:
Added a comment about why this horrible hack is necessary. Basically, the
method is poorly designed, but I didn't want to make major changes just before
a release.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Short-term fixes for metadata API parameterized type issues
> -----------------------------------------------------------
>
> Key: DRILL-7479
> URL: https://issues.apache.org/jira/browse/DRILL-7479
> Project: Apache Drill
> Issue Type: Task
> Affects Versions: 1.17.0
> Reporter: Paul Rogers
> Assignee: Paul Rogers
> Priority: Blocker
> Fix For: 1.17.0
>
>
> See DRILL-7480 for a discussion of the issues with how we currently use
> parameterized types in the metadata API.
> This ticket is for short-term fixes that convert unsafe generic types of the
> form {{StatisticsHolder}} to the form {{StatisticsHolder<?>}} so that the
> compiler does not complain with many warnings (and a few Eclipse-only errors.)
> The topic should be revisited later in the context of DRILL-7480.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)