Tag: 框rdd

一个rdd字符将被转换成一个dataframe

RDD数据将被转换成dataframe。 但我无法这样做。 ToDf不工作,我也尝试与数组RDD到数据框。 请告诉我。这个程序是用scala和sparkparsing一个样例excel import java.io.{File, FileInputStream} import org.apache.poi.xssf.usermodel.XSSFCell import org.apache.poi.xssf.usermodel.{XSSFSheet, XSSFWorkbook} import org.apache.poi.ss.usermodel.Cell._ import org.apache.spark.sql.SQLContext import org.apache.spark.SparkConf import org.apache.spark.SparkContext import org.apache.spark.sql.types.{ StructType, StructField, StringType, IntegerType }; object excel { def main(args: Array[String]) = { val sc = new SparkContext(new SparkConf().setAppName("Excel Parsing").setMaster("local[*]")) val file = new FileInputStream(new File("test.xlsx")) val wb = new XSSFWorkbook(file) val sheet […]