I am trying to load a xls/xlsx file from server
With this code https://github.com/crealytics/spark-excel
SparkConf sparkConf = new SparkConf();
SparkContext sparkContext = null;
sparkContext = new SparkContext("local", "234", sparkConf);
SparkSession sparkSession =
SparkSession.builder().sparkContext(sparkContext).getOrCreate();
SQLContext sqlContext = sparkSession.sqlContext().newSession();
Dataset<Row> dframe = sqlContext.read().format("com.crealytics.spark.excel").option("timestampFormat", "yyyy-mmm-dd HH:mm:ss").option("dataAddress", "'My Sheet'!A1").option("useHeader", "true").option("treatEmptyValuesAsNulls", "false").option("inferSchema", "true")
.load("/home/test/myfile/sample.xlsx"); // local path
This code perfectly works on local file
"/home/test/myfile/sample.xlsx"
How can i read files on server with path like this
"http://10.0.0.1:8080/serverFiles/test.xlsx"
I treid replacing the code with Server url above and got this error :
Exception in thread "main" java.io.IOException: No FileSystem for scheme: http
at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2586)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2593)
Can spark read xlsx/xls file directly from server URL ? [not for CSV]