Skip to content

Commit b7ba3f5

Browse files
author
Matthis Gördel
committed
Add classic.SparkSessionBinder with usage demonstration
1 parent 9df6411 commit b7ba3f5

2 files changed

Lines changed: 30 additions & 2 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.spark.sql.classic
19+
20+
import org.apache.spark.sql
21+
22+
trait SparkSessionBinder
23+
extends sql.SparkSessionBinder
24+
with SparkSessionProvider {
25+
override protected def spark: SparkSession = super.spark.asInstanceOf[SparkSession]
26+
}

sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,23 @@ import org.apache.spark.sql._
3030
import org.apache.spark.sql.catalyst.{InternalRow, TableIdentifier}
3131
import org.apache.spark.sql.catalyst.expressions.SpecificInternalRow
3232
import org.apache.spark.sql.catalyst.util.ArrayData
33+
import org.apache.spark.sql.classic
3334
import org.apache.spark.sql.execution.FileSourceScanExec
3435
import org.apache.spark.sql.execution.datasources.{SchemaColumnConvertNotSupportedException, SQLHadoopMapReduceCommitProtocol}
3536
import org.apache.spark.sql.execution.datasources.parquet.TestingUDT._
3637
import org.apache.spark.sql.execution.datasources.v2.BatchScanExec
3738
import org.apache.spark.sql.execution.datasources.v2.parquet.ParquetScan
3839
import org.apache.spark.sql.functions.struct
3940
import org.apache.spark.sql.internal.SQLConf
40-
import org.apache.spark.sql.test.SharedSparkSession
4141
import org.apache.spark.sql.types._
4242
import org.apache.spark.util.Utils
4343

4444
/**
4545
* A test suite that tests various Parquet queries.
4646
*/
47-
abstract class ParquetQuerySuite extends ParquetTest with SharedSparkSession {
47+
abstract class ParquetQuerySuite extends ParquetTest
48+
with QueryTest
49+
with classic.SparkSessionBinder {
4850
import testImplicits._
4951

5052
test("simple select queries") {

0 commit comments

Comments
 (0)