This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//scala create datasets | |
def randomStr(size: Int): String = { | |
import scala.util.Random | |
return Random.alphanumeric.take(size).mkString("") | |
} | |
val udfRandomStr = udf(randomStr _) | |
val dfRnd = (1 to 30000).toDF.repartition(3000) | |
val dfRnd2 = (1 to 10).toDF.withColumnRenamed("value", "value2") |