Skip to content
Closed
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
11 changes: 11 additions & 0 deletions sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,17 @@ class SQLContext(@transient val sparkContext: SparkContext)
@Experimental
object implicits extends SQLImplicits with Serializable {
protected override def _sqlContext: SQLContext = self

/**
* Converts $"col name" into an [[Column]].
* @since 1.3.0
*/
// This must live here to preserve binary compatibility with Spark < 1.5.
implicit class StringToColumn(val sc: StringContext) {
def $(args: Any*): ColumnName = {
new ColumnName(sc.s(args: _*))
}
}
}
// scalastyle:on

Expand Down
10 changes: 0 additions & 10 deletions sql/core/src/main/scala/org/apache/spark/sql/SQLImplicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ import org.apache.spark.unsafe.types.UTF8String
private[sql] abstract class SQLImplicits {
protected def _sqlContext: SQLContext

/**
* Converts $"col name" into an [[Column]].
* @since 1.3.0
*/
implicit class StringToColumn(val sc: StringContext) {
def $(args: Any*): ColumnName = {
new ColumnName(sc.s(args: _*))
}
}

/**
* An implicit conversion that turns a Scala `Symbol` into a [[Column]].
* @since 1.3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.spark.sql.test

import org.apache.spark.sql.SQLContext
import org.apache.spark.sql.{ColumnName, SQLContext}


/**
Expand Down Expand Up @@ -65,4 +65,14 @@ private[sql] trait SharedSQLContext extends SQLTestUtils {
}
}

/**
* Converts $"col name" into an [[Column]].
* @since 1.3.0
*/
// This must be duplicated here to preserve binary compatibility with Spark < 1.5.
implicit class StringToColumn(val sc: StringContext) {
def $(args: Any*): ColumnName = {
new ColumnName(sc.s(args: _*))
}
}
}