Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.apache.spark.sql.blaze

import org.apache.spark.sql.Row

class BlazeQuerySuite extends org.apache.spark.sql.QueryTest with BaseBlazeSQLSuite {

test("test partition path has url encoded character") {
withTable("t1") {
sql("create table t1 using parquet PARTITIONED BY (part) as select 1 as c1, 2 as c2, 'test test' as part")
val df = sql("select * from t1")
checkAnswer(df, Seq(Row(1, 2, "test test")))
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.lang.management.BufferPoolMXBean;
import java.lang.management.ManagementFactory;
import java.net.URI;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.hadoop.fs.FileSystem;
Expand Down Expand Up @@ -85,11 +86,12 @@ public static boolean isDriverSide() {
}

public static FSDataInputWrapper openFileAsDataInputWrapper(FileSystem fs, String path) throws Exception {
return FSDataInputWrapper$.MODULE$.wrap(fs.open(new Path(path)));
// the path is a URI string, so we need to convert it to a URI object, ref: org.apache.spark.paths.SparkPath.toPath
return FSDataInputWrapper$.MODULE$.wrap(fs.open(new Path(new URI(path))));
}

public static FSDataOutputWrapper createFileAsDataOutputWrapper(FileSystem fs, String path) throws Exception {
return FSDataOutputWrapper$.MODULE$.wrap(fs.create(new Path(path)));
return FSDataOutputWrapper$.MODULE$.wrap(fs.create(new Path(new URI(path))));
}

private static final List<BufferPoolMXBean> directMXBeans =
Expand Down