Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-3776

Float type in MySQL not properly converted to HIVE Double Type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • v2.6.0
    • v2.6.1
    • RDBMS Source
    • 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);
      }

       

       

       

       

       

       

      Attachments

        Activity

          People

            hit_lacus Xiaoxiang Yu
            hstefani Hubert STEFANI
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: