乐趣区

关于java:Spark-读取Excel

// 应用 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 读取

退出移动版