Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
v2.6.0
-
None
Description
when loading a table from mysql as source, the float type is converted as HIVE Double type, but a precision information is added which gives an error while creating hive table.
CREATE EXTERNAL TABLE IF NOT EXISTS kylin_intermediate_cube_commande_777b5b14_570a_338a_25b4_b55ad6388a93
(
COMMANDE_COM_CODE_POSTAL int
,COMMANDE_COM_COMMUNE string
... ,COMMANDE_COM_MONTANT double(12)
)
the correct code should be :
... ,COMMANDE_COM_MONTANT double
It seems that SqlUtil class should not include "double" as a type with scale
public static boolean isScaleApplicable(String typeName) {
return DataType.NUMBER_FAMILY.contains(typeName) && !DataType.INTEGER_FAMILY.contains(typeName);
}
should be changed for something similar to :
public static boolean isScaleApplicable(String typeName) {
return !"double".equals(typeName) && DataType.NUMBER_FAMILY.contains(typeName) && !DataType.INTEGER_FAMILY.contains(typeName);
}