def castValue()

in s2core/src/main/scala/org/apache/s2graph/core/types/InnerValLike.scala [224:240]


  def castValue(element: Any, classType: String): Any = {
    import InnerVal._
    element match {
      case bd: BigDecimal =>
        classType match {
          case DOUBLE => bd.doubleValue()
          case FLOAT => bd.floatValue()
          case LONG => bd.longValue()
          case INT | "int" => bd.intValue()
          case SHORT => bd.shortValue()
          case BYTE => bd.byteValue()
          case _ => throw new RuntimeException(s"not supported data type: $element, $classType")
        }
      case _ => element
//        throw new RuntimeException(s"not supported data type: $element, ${element.getClass.getCanonicalName}, $classType")
    }
  }