Skip to content

Commit 08969cd

Browse files
author
Andrew Or
committed
Fix tests
1 parent 6d9fa2f commit 08969cd

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/identifiers.scala

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ package org.apache.spark.sql.catalyst
2424
* Format (unquoted): "name" or "db.name"
2525
* Format (quoted): "`name`" or "`db`.`name`"
2626
*/
27-
private[sql] abstract class IdentifierWithDatabase(name: String) {
27+
sealed trait IdentifierWithDatabase {
28+
val name: String
2829
def database: Option[String]
2930
def quotedString: String = database.map(db => s"`$db`.`$name`").getOrElse(s"`$name`")
3031
def unquotedString: String = database.map(db => s"$db.$name").getOrElse(name)
@@ -36,15 +37,16 @@ private[sql] abstract class IdentifierWithDatabase(name: String) {
3637
* Identifies a table in a database.
3738
* If `database` is not defined, the current database is used.
3839
*/
39-
private[sql] case class TableIdentifier(
40-
table: String,
41-
database: Option[String])
42-
extends IdentifierWithDatabase(table) {
40+
case class TableIdentifier(table: String, database: Option[String])
41+
extends IdentifierWithDatabase {
42+
43+
override val name: String = table
4344

4445
def this(name: String) = this(name, None)
46+
4547
}
4648

47-
private[sql] object TableIdentifier {
49+
object TableIdentifier {
4850
def apply(tableName: String): TableIdentifier = new TableIdentifier(tableName)
4951
}
5052

@@ -53,14 +55,14 @@ private[sql] object TableIdentifier {
5355
* Identifies a function in a database.
5456
* If `database` is not defined, the current database is used.
5557
*/
56-
private[sql] case class FunctionIdentifier(
57-
funcName: String,
58-
database: Option[String])
59-
extends IdentifierWithDatabase(funcName) {
58+
case class FunctionIdentifier(funcName: String, database: Option[String])
59+
extends IdentifierWithDatabase {
60+
61+
override val name: String = funcName
6062

6163
def this(name: String) = this(name, None)
6264
}
6365

64-
private[sql] object FunctionIdentifier {
66+
object FunctionIdentifier {
6567
def apply(funcName: String): FunctionIdentifier = new FunctionIdentifier(funcName)
6668
}

0 commit comments

Comments
 (0)