scala> "astron".to
to toBuffer toDouble toInt toList toMap toShort toTraversable
toArray toByte toFloat toIterable toLong toSeq toStream toUpperCase
toBoolean toCharArray toIndexedSeq toIterator toLowerCase toSet toString toVector
scala> "astron".to
res0: scala.collection.immutable.IndexedSeq[Char] = Vector(a, s, t, r, o, n)
scala> "astron".toBuffer
res1: scala.collection.mutable.Buffer[Char] = ArrayBuffer(a, s, t, r, o, n)
scala> "astron".toDouble
java.lang.NumberFormatException: For input string: "astron"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.lang.Double.parseDouble(Double.java:538)
at scala.collection.immutable.StringLike$class.toDouble(StringLike.scala:284)
at scala.collection.immutable.StringOps.toDouble(StringOps.scala:29)
... 48 elided
scala> "astron".toInt
java.lang.NumberFormatException: For input string: "astron"
at java.lang.NumberFormatException.forInputString(Num
spark to函数
最新推荐文章于 2024-04-09 09:02:32 发布
本文深入探讨了Apache Spark中`to`函数的使用,详细解释了如何在Scala编程环境中利用该函数进行数据转换和操作。内容包括`to`函数的基本语法、参数说明、常见用例及其在大数据处理中的应用实例。
摘要由CSDN通过智能技术生成