@Test public void testCompatibleHiveType() { String compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.BOOLEAN, null); assertEquals(compatibleTypeName, EnumHiveToGpdbType.BooleanType.getTypeName()); compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.BYTEA, null); assertEquals(compatibleTypeName, EnumHiveToGpdbType.BinaryType.getTypeName()); compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.BPCHAR, null); assertEquals(compatibleTypeName, EnumHiveToGpdbType.CharType.getTypeName()); compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.BIGINT, null); assertEquals(compatibleTypeName, EnumHiveToGpdbType.BigintType.getTypeName()); compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.SMALLINT, null); assertEquals(compatibleTypeName, EnumHiveToGpdbType.SmallintType.getTypeName()); compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.INTEGER, null); assertEquals(compatibleTypeName, EnumHiveToGpdbType.IntType.getTypeName()); compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.TEXT, null); assertEquals(compatibleTypeName, EnumHiveToGpdbType.StringType.getTypeName()); compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.REAL, null); assertEquals(compatibleTypeName, EnumHiveToGpdbType.FloatType.getTypeName()); compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.FLOAT8, null); assertEquals(compatibleTypeName, EnumHiveToGpdbType.DoubleType.getTypeName()); compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.VARCHAR, null); assertEquals(compatibleTypeName, EnumHiveToGpdbType.VarcharType.getTypeName()); compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.DATE, null); assertEquals(compatibleTypeName, EnumHiveToGpdbType.DateType.getTypeName()); compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.TIMESTAMP, null); assertEquals(compatibleTypeName, EnumHiveToGpdbType.TimestampType.getTypeName()); compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.NUMERIC, null); assertEquals(compatibleTypeName, EnumHiveToGpdbType.DecimalType.getTypeName()); try { compatibleTypeName = HiveUtilities.toCompatibleHiveType(DataType.UNSUPPORTED_TYPE, null); fail("should fail because there is no mapped Hive type"); } catch (UnsupportedTypeException e) { String errorMsg = "Unable to find compatible Hive type for given GPDB's type: " + DataType.UNSUPPORTED_TYPE; assertEquals(errorMsg, e.getMessage()); } }
public static String toCompatibleHiveType(DataType type, Integer[] modifiers) { EnumHiveToGpdbType hiveToGpdbType = EnumHiveToGpdbType.getCompatibleHiveToGpdbType(type); return EnumHiveToGpdbType.getFullHiveTypeName(hiveToGpdbType, modifiers); }
HiveUtilities { public static String toCompatibleHiveType(DataType type, Integer[] modifiers) { EnumHiveToGpdbType hiveToGpdbType = EnumHiveToGpdbType.getCompatibleHiveToGpdbType(type); return EnumHiveToGpdbType.getFullHiveTypeName(hiveToGpdbType, modifiers); } }
HiveUtilities { public static String toCompatibleHiveType(DataType type, Integer[] modifiers) { EnumHiveToGpdbType hiveToGpdbType = EnumHiveToGpdbType.getCompatibleHiveToGpdbType(type); return EnumHiveToGpdbType.getFullHiveTypeName(hiveToGpdbType, modifiers); }  }
HiveUtilities { public static String toCompatibleHiveType(DataType type, Integer[] modifiers) { EnumHiveToGpdbType hiveToGpdbType = EnumHiveToGpdbType.getCompatibleHiveToGpdbType(type); return EnumHiveToGpdbType.getFullHiveTypeName(hiveToGpdbType, modifiers); }  static Metadata.Field mapHiveType(FieldSchema hiveColumn); static String toCompatibleHiveType(DataType type, Integer[] modifiers); static void validateTypeCompatible(DataType gpdbDataType, Integer[] gpdbTypeMods, String hiveType, String gpdbColumnName); static HiveUserData parseHiveUserData(RequestContext context); static Deserializer createDeserializer(String serdeClassName); static Reader getOrcReader(Configuration configuration, RequestContext requestContext); }
HiveUtilities { public static String toCompatibleHiveType(DataType type, Integer[] modifiers) { EnumHiveToGpdbType hiveToGpdbType = EnumHiveToGpdbType.getCompatibleHiveToGpdbType(type); return EnumHiveToGpdbType.getFullHiveTypeName(hiveToGpdbType, modifiers); }  static Metadata.Field mapHiveType(FieldSchema hiveColumn); static String toCompatibleHiveType(DataType type, Integer[] modifiers); static void validateTypeCompatible(DataType gpdbDataType, Integer[] gpdbTypeMods, String hiveType, String gpdbColumnName); static HiveUserData parseHiveUserData(RequestContext context); static Deserializer createDeserializer(String serdeClassName); static Reader getOrcReader(Configuration configuration, RequestContext requestContext);  }