Repository: incubator-hawq Updated Branches: refs/heads/HAWQ-992 52bd1511d -> c2ff7ad65
HAWQ-992. Added Javadocs. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/c2ff7ad6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/c2ff7ad6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/c2ff7ad6 Branch: refs/heads/HAWQ-992 Commit: c2ff7ad6545c64a45ae7eaffa15b36b3c8319f21 Parents: 52bd151 Author: Oleksandr Diachenko <[email protected]> Authored: Tue Sep 6 15:23:31 2016 -0700 Committer: Oleksandr Diachenko <[email protected]> Committed: Tue Sep 6 15:23:31 2016 -0700 ---------------------------------------------------------------------- .../pxf/plugins/hive/utilities/EnumHiveToHawqType.java | 2 +- .../hawq/pxf/plugins/hive/utilities/HiveUtilities.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/c2ff7ad6/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/EnumHiveToHawqType.java ---------------------------------------------------------------------- diff --git a/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/EnumHiveToHawqType.java b/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/EnumHiveToHawqType.java index f90f39a..0290f9c 100644 --- a/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/EnumHiveToHawqType.java +++ b/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/EnumHiveToHawqType.java @@ -129,7 +129,7 @@ public enum EnumHiveToHawqType { * @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) { + public static EnumHiveToHawqType getCompatibleHiveToHawqType(DataType dataType) { SortedSet<EnumHiveToHawqType> types = new TreeSet<EnumHiveToHawqType>( new Comparator<EnumHiveToHawqType>() { http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/c2ff7ad6/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java ---------------------------------------------------------------------- diff --git a/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java b/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java index 469ecbf..1d928ba 100644 --- a/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java +++ b/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java @@ -269,12 +269,21 @@ public class HiveUtilities { */ public static String toCompatibleHiveType(DataType type) { - EnumHiveToHawqType hiveToHawqType = EnumHiveToHawqType.getCompatibleHawqToHiveType(type); + EnumHiveToHawqType hiveToHawqType = EnumHiveToHawqType.getCompatibleHiveToHawqType(type); return hiveToHawqType.getTypeName(); } + /** + * Validates whether given HAWQ and Hive data types are compatible + * + * @param hawqDataType HAWQ data type + * @param hawqTypeMods HAWQ type modifiers + * @param hiveType full Hive type, i.e. decimal(10,2) + * @param hawqColumnName Hive column name + * @throws UnsupportedTypeException if types are incompatible + */ public static void validateTypeCompatible(DataType hawqDataType, Integer[] hawqTypeMods, String hiveType, String hawqColumnName) { EnumHiveToHawqType hiveToHawqType = EnumHiveToHawqType.getHiveToHawqType(hiveType);
