rdblue commented on a change in pull request #25104: [SPARK-28341][SQL] refine
the v2 session catalog config
URL: https://github.com/apache/spark/pull/25104#discussion_r303084912
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/sources/v2/DataSourceV2SQLSuite.scala
##########
@@ -22,25 +22,31 @@ import scala.collection.JavaConverters._
import org.scalatest.BeforeAndAfter
import org.apache.spark.SparkException
-import org.apache.spark.sql.{AnalysisException, QueryTest}
-import org.apache.spark.sql.catalog.v2.Identifier
+import org.apache.spark.sql.{AnalysisException, QueryTest, Row, SparkSession}
+import org.apache.spark.sql.catalog.v2.{Identifier, RequiresSessionCatalog}
import org.apache.spark.sql.catalyst.analysis.{NoSuchTableException,
TableAlreadyExistsException}
-import org.apache.spark.sql.execution.datasources.v2.V2SessionCatalog
+import org.apache.spark.sql.catalyst.catalog.SessionCatalog
import org.apache.spark.sql.execution.datasources.v2.orc.OrcDataSourceV2
-import org.apache.spark.sql.internal.SQLConf.V2_SESSION_CATALOG
+import org.apache.spark.sql.internal.StaticSQLConf
import org.apache.spark.sql.test.SharedSQLContext
import org.apache.spark.sql.types.{ArrayType, DoubleType, IntegerType,
LongType, MapType, StringType, StructField, StructType, TimestampType}
class DataSourceV2SQLSuite extends QueryTest with SharedSQLContext with
BeforeAndAfter {
- import org.apache.spark.sql.catalog.v2.CatalogV2Implicits._
-
private val orc2 = classOf[OrcDataSourceV2].getName
+ private def getTestCatalog() = {
+ spark.sessionState.analyzer.catalogManager.catalog("testcat")
+ .asInstanceOf[TestInMemoryTableCatalog]
+ }
+
+ private def getV2SessionCatalog(session: SparkSession) = {
Review comment:
It is odd that this requires passing in the session when `getTestCatalog`
does not. I would prefer not using this function in places where the session is
different.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]