You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by kavinderd <gi...@git.apache.org> on 2016/09/01 00:17:28 UTC

[GitHub] incubator-hawq pull request #873: HAWQ-992. PXF Hive data type check in Frag...

Github user kavinderd commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/873#discussion_r77096574
  
    --- Diff: pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/EnumHiveToHawqType.java ---
    @@ -110,4 +122,68 @@ public static EnumHiveToHawqType getHiveToHawqType(String hiveType) {
                     + hiveType + " to HAWQ's type");
         }
     
    +
    +    /**
    +     * 
    +     * @param dataType Hawq data type
    +     * @return compatible Hive type to given Hawq type, if there are more than one compatible types, it returns one with bigger size
    +     * @throws UnsupportedTypeException if there is no corresponding Hive type for given Hawq type
    +     */
    +    public static EnumHiveToHawqType getCompatibleHawqToHiveType(DataType dataType) {
    +
    +        SortedSet<EnumHiveToHawqType> types = new TreeSet<EnumHiveToHawqType>(
    +                new Comparator<EnumHiveToHawqType>() {
    +                    public int compare(EnumHiveToHawqType a,
    +                            EnumHiveToHawqType b) {
    +                        return Byte.compare(a.getSize(), b.getSize());
    +                    }
    +                });
    --- End diff --
    
    Can this `types` variable be instantiated outside the method? It doesn't changed based on input right?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---