关于java:Spark-读取Excel

51次阅读

共计 707 个字符,预计需要花费 2 分钟才能阅读完成。

// 应用 com.crealytics.spark.excel
        <dependency>
            <groupId>com.crealytics</groupId>
            <artifactId>spark-excel_2.12</artifactId>
            <version>3.2.1_0.17.1</version>
        </dependency>
spark.read().format("com.crealytics.spark.excel")
                        .option("useHeader", "true")
                        .option("header", "true")
                        .option("treatEmptyValuesAsNulls", "true")
                        .option("inferSchema", "true")
                        .option("addColorColumns", "true")
                        .option("timestampFormat", "yyyy/MM/dd HH:mm:ss")
                        .load(url);
// 应用 org.zuinnote.spark.office.excel
        <dependency>
            <groupId>com.github.zuinnote</groupId>
            <artifactId>spark-hadoopoffice-ds_2.12</artifactId>
            <version>1.6.4</version>
        </dependency>
spark.read().format("org.zuinnote.spark.office.excel")
                        .option("read.spark.simpleMode",true)
                        .load(url);

// todo poi 读取

正文完
 0