Skip to content

Commit ecad36b

Browse files
authored
fix build error and code style (#781)
1 parent 320772d commit ecad36b

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

spark-extension-shims-spark3/src/test/scala/org/apache/spark/sql/blaze/BlazeFunctionSuite.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class BlazeFunctionSuite extends org.apache.spark.sql.QueryTest with BaseBlazeSQ
2222
test("sum function with float input") {
2323
withTable("t1") {
2424
withSQLConf("spark.blaze.enable" -> "false") {
25-
sql("set spark.blaze.enable=false")
26-
sql("create table t1 using parquet as select 1.0f as c1")
27-
val df = sql("select sum(c1) from t1")
28-
checkAnswer(df, Seq(Row(1.23, 1.1)))
25+
sql("set spark.blaze.enable=false")
26+
sql("create table t1 using parquet as select 1.0f as c1")
27+
val df = sql("select sum(c1) from t1")
28+
checkAnswer(df, Seq(Row(1.23, 1.1)))
2929
}
3030
}
3131
}

spark-extension/src/main/scala/org/apache/spark/sql/blaze/NativeRDD.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import org.apache.spark.SparkContext
2828
import org.apache.spark.TaskContext
2929
import org.blaze.protobuf.PhysicalPlanNode
3030

31-
3231
class NativeRDD(
3332
@transient private val rddSparkContext: SparkContext,
3433
val metrics: MetricNode,

spark-extension/src/main/scala/org/apache/spark/sql/execution/blaze/arrowio/ArrowFFIExporter.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class ArrowFFIExporter(rowIter: Iterator[InternalRow], schema: StructType) {
8585
val arrowWriter = ArrowWriter.create(root)
8686
var rowCount = 0
8787

88-
rowCount += 1
88+
rowCount += 1
8989
def processRows(): Unit = {
9090
while (rowIter.hasNext
9191
&& rowCount < maxBatchNumRows
@@ -94,6 +94,9 @@ class ArrowFFIExporter(rowIter: Iterator[InternalRow], schema: StructType) {
9494
rowCount += 1
9595
}
9696
}
97+
val currentUserInfo = UserGroupInformation.getCurrentUser
98+
val nativeCurrentUser = NativeHelper.currentUser
99+
val isNativeCurrentUser = currentUserInfo.equals(nativeCurrentUser)
97100
// if current user is native user, process rows directly
98101
if (isNativeCurrentUser) {
99102
processRows()

0 commit comments

Comments
 (0)