Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scalastyle plugin to shim module #447

Merged
merged 1 commit into from
Jul 28, 2020
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
4 changes: 4 additions & 0 deletions shims/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.scalastyle</groupId>
<artifactId>scalastyle-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import com.nvidia.spark.rapids.spark300.RapidsShuffleManager

import org.apache.spark.SparkEnv
import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.expressions.aggregate.{First, Last}
import org.apache.spark.sql.catalyst.plans.JoinType
import org.apache.spark.sql.execution._
import org.apache.spark.sql.execution.datasources.HadoopFsRelation
import org.apache.spark.sql.execution.joins.{BroadcastHashJoinExec, BroadcastNestedLoopJoinExec, HashJoin, SortMergeJoinExec}
import org.apache.spark.sql.execution.joins.ShuffledHashJoinExec
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.plans.JoinType
import org.apache.spark.sql.rapids.GpuTimeSub
import org.apache.spark.sql.rapids.execution.GpuBroadcastNestedLoopJoinExecBase
import org.apache.spark.sql.rapids.shims.spark300._
Expand Down Expand Up @@ -129,7 +129,7 @@ class Spark300Shims extends SparkShims {
(join, conf, p, r) => new GpuBroadcastHashJoinMeta(join, conf, p, r)),
GpuOverrides.exec[ShuffledHashJoinExec](
"Implementation of join using hashed shuffled data",
(join, conf, p, r) => new GpuShuffledHashJoinMeta(join, conf, p, r)),
(join, conf, p, r) => new GpuShuffledHashJoinMeta(join, conf, p, r))
).map(r => (r.getClassFor.asSubclass(classOf[SparkPlan]), r)).toMap
}

Expand Down Expand Up @@ -178,7 +178,7 @@ class Spark300Shims extends SparkShims {

override def convertToGpu(): GpuExpression =
GpuLast(child.convertToGpu(), ignoreNulls.convertToGpu())
}),
})
).map(r => (r.getClassFor.asSubclass(classOf[Expression]), r)).toMap
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
package com.nvidia.spark.rapids.shims.spark301

import com.nvidia.spark.rapids._
import com.nvidia.spark.rapids.spark301.RapidsShuffleManager
import com.nvidia.spark.rapids.shims.spark300.Spark300Shims
import com.nvidia.spark.rapids.spark301.RapidsShuffleManager

import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.expressions.aggregate.{First, Last}
import org.apache.spark.sql.execution._

class Spark301Shims extends Spark300Shims {

Expand All @@ -38,7 +37,7 @@ class Spark301Shims extends Spark300Shims {
(a, conf, p, r) => new ExprMeta[Last](a, conf, p, r) {
override def convertToGpu(): GpuExpression =
GpuLast(childExprs(0).convertToGpu(), a.ignoreNulls)
}),
})
).map(r => (r.getClassFor.asSubclass(classOf[Expression]), r)).toMap

override def getExprs: Map[Class[_ <: Expression], ExprRule[_ <: Expression]] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package com.nvidia.spark.rapids.shims.spark310
import java.time.ZoneId

import com.nvidia.spark.rapids._
import com.nvidia.spark.rapids.spark310.RapidsShuffleManager
import com.nvidia.spark.rapids.shims.spark301.Spark301Shims
import com.nvidia.spark.rapids.spark310.RapidsShuffleManager

import org.apache.spark.SparkEnv
import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder
Expand All @@ -33,9 +33,9 @@ import org.apache.spark.sql.execution.joins.ShuffledHashJoinExec
import org.apache.spark.sql.rapids.GpuTimeSub
import org.apache.spark.sql.rapids.execution.GpuBroadcastNestedLoopJoinExecBase
import org.apache.spark.sql.rapids.shims.spark310._
import org.apache.spark.unsafe.types.CalendarInterval
import org.apache.spark.sql.types._
import org.apache.spark.storage.{BlockId, BlockManagerId}
import org.apache.spark.unsafe.types.CalendarInterval

class Spark310Shims extends Spark301Shims {

Expand All @@ -48,7 +48,8 @@ class Spark310Shims extends Spark301Shims {
udfName: Option[String] = None,
nullable: Boolean = true,
udfDeterministic: Boolean = true): Expression = {
ScalaUDF(function, dataType, children, inputEncoders, outputEncoder, udfName, nullable, udfDeterministic)
ScalaUDF(function, dataType, children, inputEncoders, outputEncoder, udfName, nullable,
udfDeterministic)
}

override def getMapSizesByExecutorId(
Expand Down Expand Up @@ -114,7 +115,7 @@ class Spark310Shims extends Spark301Shims {
override def convertToGpu(lhs: Expression, rhs: Expression): GpuExpression =
GpuTimeSub(lhs, rhs)
}
),
)
).map(r => (r.getClassFor.asSubclass(classOf[Expression]), r)).toMap
exprs310 ++ super.exprs301
}
Expand Down Expand Up @@ -155,7 +156,7 @@ class Spark310Shims extends Spark301Shims {
(join, conf, p, r) => new GpuBroadcastHashJoinMeta(join, conf, p, r)),
GpuOverrides.exec[ShuffledHashJoinExec](
"Implementation of join using hashed shuffled data",
(join, conf, p, r) => new GpuShuffledHashJoinMeta(join, conf, p, r)),
(join, conf, p, r) => new GpuShuffledHashJoinMeta(join, conf, p, r))
).map(r => (r.getClassFor.asSubclass(classOf[SparkPlan]), r)).toMap
}

Expand Down