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 missing spark shim test suites #7673

Merged
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,32 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.nvidia.spark.rapids.shims.spark311;

import com.nvidia.spark.rapids._
import com.nvidia.spark.rapids.shims.SparkShimImpl
import org.scalatest.FunSuite

class SparkShimsSuite extends FunSuite with FQSuiteName {
test("spark shims version") {
assert(SparkShimImpl.getSparkShimVersion === SparkShimVersion(3, 1, 1))
}

test("shuffle manager class") {
assert(ShimLoader.getRapidsShuffleManagerClass ===
classOf[com.nvidia.spark.rapids.spark311.RapidsShuffleManager].getCanonicalName)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.nvidia.spark.rapids.shims.spark312;

import com.nvidia.spark.rapids._
import com.nvidia.spark.rapids.shims.SparkShimImpl
import org.scalatest.FunSuite

class SparkShimsSuite extends FunSuite with FQSuiteName {
test("spark shims version") {
assert(SparkShimImpl.getSparkShimVersion === SparkShimVersion(3, 1, 2))
}

test("shuffle manager class") {
assert(ShimLoader.getRapidsShuffleManagerClass ===
classOf[com.nvidia.spark.rapids.spark312.RapidsShuffleManager].getCanonicalName)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.nvidia.spark.rapids.shims.spark313;

import com.nvidia.spark.rapids._
import com.nvidia.spark.rapids.shims.SparkShimImpl
import org.scalatest.FunSuite

class SparkShimsSuite extends FunSuite with FQSuiteName {
test("spark shims version") {
assert(SparkShimImpl.getSparkShimVersion === SparkShimVersion(3, 1, 3))
}

test("shuffle manager class") {
assert(ShimLoader.getRapidsShuffleManagerClass ===
classOf[com.nvidia.spark.rapids.spark313.RapidsShuffleManager].getCanonicalName)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,13 +16,13 @@

package com.nvidia.spark.rapids.shims.spark320;

import com.nvidia.spark.rapids.{ShimLoader, SparkShimVersion, TypeSig}
import com.nvidia.spark.rapids._
import com.nvidia.spark.rapids.shims.SparkShimImpl
import org.scalatest.FunSuite

import org.apache.spark.sql.types.{DayTimeIntervalType, YearMonthIntervalType}

class Spark320ShimsSuite extends FunSuite {
class SparkShimsSuite extends FunSuite with FQSuiteName {
test("spark shims version") {
assert(SparkShimImpl.getSparkShimVersion === SparkShimVersion(3, 2, 0))
}
Expand All @@ -32,7 +32,7 @@ class Spark320ShimsSuite extends FunSuite {
classOf[com.nvidia.spark.rapids.spark320.RapidsShuffleManager].getCanonicalName)
}

test("TypeSig320") {
test("TypeSig") {
val check = TypeSig.DAYTIME + TypeSig.YEARMONTH
assert(check.isSupportedByPlugin(DayTimeIntervalType()) == true)
assert(check.isSupportedByPlugin(YearMonthIntervalType()) == true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,13 +16,13 @@

package com.nvidia.spark.rapids.shims.spark321;

import com.nvidia.spark.rapids.{ShimLoader, SparkShimVersion, TypeSig}
import com.nvidia.spark.rapids._
import com.nvidia.spark.rapids.shims.SparkShimImpl
import org.scalatest.FunSuite

import org.apache.spark.sql.types.{DayTimeIntervalType, YearMonthIntervalType}

class Spark321ShimsSuite extends FunSuite {
class SparkShimsSuite extends FunSuite with FQSuiteName {
test("spark shims version") {
assert(SparkShimImpl.getSparkShimVersion === SparkShimVersion(3, 2, 1))
}
Expand All @@ -32,7 +32,7 @@ class Spark321ShimsSuite extends FunSuite {
classOf[com.nvidia.spark.rapids.spark321.RapidsShuffleManager].getCanonicalName)
}

test("TypeSig321") {
test("TypeSig") {
val check = TypeSig.DAYTIME + TypeSig.YEARMONTH
assert(check.isSupportedByPlugin(DayTimeIntervalType()) == true)
assert(check.isSupportedByPlugin(YearMonthIntervalType()) == true)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.nvidia.spark.rapids.shims.spark321cdh;

import com.nvidia.spark.rapids._
import org.scalatest.FunSuite

import org.apache.spark.sql.types.{DayTimeIntervalType, YearMonthIntervalType}

class SparkShimsSuite extends FunSuite with FQSuiteName {
test("spark shims version") {
assert(VersionUtils.cmpSparkVersion(3, 2, 1) === 0)
}

test("shuffle manager class") {
assert(ShimLoader.getRapidsShuffleManagerClass ===
classOf[com.nvidia.spark.rapids.spark321cdh.RapidsShuffleManager].getCanonicalName)
}

test("TypeSig") {
val check = TypeSig.DAYTIME + TypeSig.YEARMONTH
assert(check.isSupportedByPlugin(DayTimeIntervalType()) == true)
assert(check.isSupportedByPlugin(YearMonthIntervalType()) == true)
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,13 +16,13 @@

package com.nvidia.spark.rapids.shims.spark322;

import com.nvidia.spark.rapids.{ShimLoader, SparkShimVersion, TypeSig}
import com.nvidia.spark.rapids._
import com.nvidia.spark.rapids.shims.SparkShimImpl
import org.scalatest.FunSuite

import org.apache.spark.sql.types.{DayTimeIntervalType, YearMonthIntervalType}

class Spark322ShimsSuite extends FunSuite {
class SparkShimsSuite extends FunSuite with FQSuiteName {
test("spark shims version") {
assert(SparkShimImpl.getSparkShimVersion === SparkShimVersion(3, 2, 2))
}
Expand All @@ -32,7 +32,7 @@ class Spark322ShimsSuite extends FunSuite {
classOf[com.nvidia.spark.rapids.spark322.RapidsShuffleManager].getCanonicalName)
}

test("TypeSig322") {
test("TypeSig") {
val check = TypeSig.DAYTIME + TypeSig.YEARMONTH
assert(check.isSupportedByPlugin(DayTimeIntervalType()) == true)
assert(check.isSupportedByPlugin(YearMonthIntervalType()) == true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, NVIDIA CORPORATION.
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,13 +16,13 @@

package com.nvidia.spark.rapids.shims.spark323;

import com.nvidia.spark.rapids.{ShimLoader, SparkShimVersion, TypeSig}
import com.nvidia.spark.rapids._
import com.nvidia.spark.rapids.shims.SparkShimImpl
import org.scalatest.FunSuite

import org.apache.spark.sql.types.{DayTimeIntervalType, YearMonthIntervalType}

class Spark323ShimsSuite extends FunSuite {
class SparkShimsSuite extends FunSuite with FQSuiteName {
test("spark shims version") {
assert(SparkShimImpl.getSparkShimVersion === SparkShimVersion(3, 2, 3))
}
Expand All @@ -32,7 +32,7 @@ class Spark323ShimsSuite extends FunSuite {
classOf[com.nvidia.spark.rapids.spark323.RapidsShuffleManager].getCanonicalName)
}

test("TypeSig323") {
test("TypeSig") {
val check = TypeSig.DAYTIME + TypeSig.YEARMONTH
assert(check.isSupportedByPlugin(DayTimeIntervalType()) == true)
assert(check.isSupportedByPlugin(YearMonthIntervalType()) == true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,13 +16,13 @@

package com.nvidia.spark.rapids.shims.spark330;

import com.nvidia.spark.rapids.{ShimLoader, SparkShimVersion, TypeSig}
import com.nvidia.spark.rapids._
import com.nvidia.spark.rapids.shims.SparkShimImpl
import org.scalatest.FunSuite

import org.apache.spark.sql.types.{DayTimeIntervalType, YearMonthIntervalType}

class Spark330ShimsSuite extends FunSuite {
class SparkShimsSuite extends FunSuite with FQSuiteName {
test("spark shims version") {
assert(SparkShimImpl.getSparkShimVersion === SparkShimVersion(3, 3, 0))
}
Expand All @@ -32,7 +32,7 @@ class Spark330ShimsSuite extends FunSuite {
classOf[com.nvidia.spark.rapids.spark330.RapidsShuffleManager].getCanonicalName)
}

test("TypeSig330") {
test("TypeSig") {
val check = TypeSig.DAYTIME + TypeSig.YEARMONTH
assert(check.isSupportedByPlugin(DayTimeIntervalType()) == true)
assert(check.isSupportedByPlugin(YearMonthIntervalType()) == true)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.nvidia.spark.rapids.shims.spark330cdh;

import com.nvidia.spark.rapids._
import org.scalatest.FunSuite

import org.apache.spark.sql.types.{DayTimeIntervalType, YearMonthIntervalType}

class SparkShimsSuite extends FunSuite with FQSuiteName {
test("spark shims version") {
assert(VersionUtils.cmpSparkVersion(3, 3, 0) === 0)
}

test("shuffle manager class") {
assert(ShimLoader.getRapidsShuffleManagerClass ===
classOf[com.nvidia.spark.rapids.spark330cdh.RapidsShuffleManager].getCanonicalName)
}

test("TypeSig") {
val check = TypeSig.DAYTIME + TypeSig.YEARMONTH
assert(check.isSupportedByPlugin(DayTimeIntervalType()) == true)
assert(check.isSupportedByPlugin(YearMonthIntervalType()) == true)
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, NVIDIA CORPORATION.
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,13 +16,13 @@

package com.nvidia.spark.rapids.shims.spark331;

import com.nvidia.spark.rapids.{ShimLoader, SparkShimVersion, TypeSig}
import com.nvidia.spark.rapids._
import com.nvidia.spark.rapids.shims.SparkShimImpl
import org.scalatest.FunSuite

import org.apache.spark.sql.types.{DayTimeIntervalType, YearMonthIntervalType}

class Spark331ShimsSuite extends FunSuite {
class SparkShimsSuite extends FunSuite with FQSuiteName {
test("spark shims version") {
assert(SparkShimImpl.getSparkShimVersion === SparkShimVersion(3, 3, 1))
}
Expand All @@ -32,7 +32,7 @@ class Spark331ShimsSuite extends FunSuite {
classOf[com.nvidia.spark.rapids.spark331.RapidsShuffleManager].getCanonicalName)
}

test("TypeSig331") {
test("TypeSig") {
val check = TypeSig.DAYTIME + TypeSig.YEARMONTH
assert(check.isSupportedByPlugin(DayTimeIntervalType()) == true)
assert(check.isSupportedByPlugin(YearMonthIntervalType()) == true)
Expand Down
Loading