Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/347.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在配置单元中将字符串隐式转换为int时会发生什么?_Java_Hadoop_Hive - Fatal编程技术网

Java 在配置单元中将字符串隐式转换为int时会发生什么?

Java 在配置单元中将字符串隐式转换为int时会发生什么?,java,hadoop,hive,Java,Hadoop,Hive,在使用配置单元查询数据时,遇到以下这种情况: 选择“645598305454469410”=645598305454699395==>true 所以我想知道在配置单元中将字符串隐式转换为int时会发生什么 谢谢。双方都被选为替补 hive> select '6455983054544699410' = 6455983054544699395; WARNING: Comparing a bigint and a string may result in a loss of precisi

在使用配置单元查询数据时,遇到以下这种情况:

选择“645598305454469410”=645598305454699395==>true

所以我想知道在配置单元中将字符串隐式转换为int时会发生什么


谢谢。

双方都被选为替补

hive> select '6455983054544699410' =  6455983054544699395;
WARNING: Comparing a bigint and a string may result in a loss of precision.
OK
_c0
true



双方都被要求加倍努力

hive> select '6455983054544699410' =  6455983054544699395;
WARNING: Comparing a bigint and a string may result in a loss of precision.
OK
_c0
true


// For now, if a bigint is going to be cast to a double throw an error or warning
      if ((oiTypeInfo0.equals(TypeInfoFactory.stringTypeInfo) && oiTypeInfo1.equals(TypeInfoFactory.longTypeInfo)) ||
          (oiTypeInfo0.equals(TypeInfoFactory.longTypeInfo) && oiTypeInfo1.equals(TypeInfoFactory.stringTypeInfo))) {
        String error = StrictChecks.checkTypeSafety(conf);
        if (error != null) throw new UDFArgumentException(error);
        console.printError("WARNING: Comparing a bigint and a string may result in a loss of precision.");
      } else if ((oiTypeInfo0.equals(TypeInfoFactory.doubleTypeInfo) && oiTypeInfo1.equals(TypeInfoFactory.longTypeInfo)) ||
          (oiTypeInfo0.equals(TypeInfoFactory.longTypeInfo) && oiTypeInfo1.equals(TypeInfoFactory.doubleTypeInfo))) {
        String error = StrictChecks.checkTypeSafety(conf);
        if (error != null) throw new UDFArgumentException(error);
        console.printError("WARNING: Comparing a bigint and a double may result in a loss of precision.");
      }