You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Shaofeng SHI (JIRA)" <ji...@apache.org> on 2019/02/22 10:35:00 UTC

[jira] [Resolved] (KYLIN-3776) Float type in MySQL not properly converted to HIVE Double Type

     [ https://issues.apache.org/jira/browse/KYLIN-3776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shaofeng SHI resolved KYLIN-3776.
---------------------------------
    Resolution: Fixed

> Float type in MySQL not properly converted to HIVE Double Type
> --------------------------------------------------------------
>
>                 Key: KYLIN-3776
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3776
>             Project: Kylin
>          Issue Type: Bug
>          Components: RDBMS Source
>    Affects Versions: v2.6.0
>            Reporter: Hubert STEFANI
>            Assignee: XiaoXiang Yu
>            Priority: Major
>             Fix For: v2.6.1
>
>
>  
> 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.
> {quote}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)
> )
> {quote}
> the correct code should be : 
> {quote}... ,COMMANDE_COM_MONTANT double
> {quote}
> It seems that SqlUtil class should not include "double" as a type with scale
> {color:#000080}public static boolean {color}isScaleApplicable(String typeName) {
>  {color:#000080}return {color}DataType.{color:#660e7a}NUMBER_FAMILY{color}.contains(typeName) && !DataType.{color:#660e7a}INTEGER_FAMILY{color}.contains(typeName);
> }
> should be changed for something similar to :
>  
> {color:#000080}public static boolean {color}isScaleApplicable(String typeName) {
>  {color:#000080}return {color}!{color:#008000}"double"{color}.equals(typeName) && DataType.{color:#660e7a}NUMBER_FAMILY{color}.contains(typeName) && !DataType.{color:#660e7a}INTEGER_FAMILY{color}.contains(typeName);
> }
>  
>  
>  
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)