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

[SPARK-11780][SQL] Add type aliases backwards compatibility. #9935

Closed
wants to merge 1 commit into from
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import scala.language.existentials
import org.apache.spark.sql.Row
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.util._
import org.apache.spark.sql.types._
import org.apache.spark.sql.types.{ArrayBasedMapData => _, _}
import org.apache.spark.unsafe.types.UTF8String

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import org.apache.spark.sql.catalyst.expressions.aggregate._
import org.apache.spark.sql.catalyst.plans._
import org.apache.spark.sql.catalyst.plans.logical._
import org.apache.spark.sql.catalyst.util.DataTypeParser
import org.apache.spark.sql.types._
import org.apache.spark.sql.types.{DataTypeParser => _, _}
import org.apache.spark.unsafe.types.CalendarInterval

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.spark.sql.types

import org.apache.spark.sql.catalyst.util.ArrayData
import org.apache.spark.sql.catalyst.util
import org.json4s.JsonDSL._

import org.apache.spark.annotation.DeveloperApi
Expand Down Expand Up @@ -86,7 +86,7 @@ case class ArrayType(elementType: DataType, containsNull: Boolean) extends DataT
}

@transient
private[sql] lazy val interpretedOrdering: Ordering[ArrayData] = new Ordering[ArrayData] {
private[sql] lazy val interpretedOrdering: Ordering[util.ArrayData] = new Ordering[util.ArrayData] {
private[this] val elementOrdering: Ordering[Any] = elementType match {
case dt: AtomicType => dt.ordering.asInstanceOf[Ordering[Any]]
case a : ArrayType => a.interpretedOrdering.asInstanceOf[Ordering[Any]]
Expand All @@ -95,7 +95,7 @@ case class ArrayType(elementType: DataType, containsNull: Boolean) extends DataT
throw new IllegalArgumentException(s"Type $other does not support ordered operations")
}

def compare(x: ArrayData, y: ArrayData): Int = {
def compare(x: util.ArrayData, y: util.ArrayData): Int = {
val leftArray = x
val rightArray = y
val minLength = scala.math.min(leftArray.numElements(), rightArray.numElements())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,24 @@ package org.apache.spark.sql
* Contains a type system for attributes produced by relations, including complex types like
* structs, arrays and maps.
*/
package object types
package object types {

/* Aliases for backwards compatibility. See SPARK-11780. */
@deprecated("Moved to org.apache.spark.sql.catalyst.util.ArrayBasedMapData", since = "1.6.0")
type ArrayBasedMapData = org.apache.spark.sql.catalyst.util.ArrayBasedMapData
@deprecated("Moved to org.apache.spark.sql.catalyst.util.ArrayBasedMapData", since = "1.6.0")
val ArrayBasedMapData = org.apache.spark.sql.catalyst.util.ArrayBasedMapData
@deprecated("Moved to org.apache.spark.sql.catalyst.util.ArrayData", since = "1.6.0")
type ArrayData = org.apache.spark.sql.catalyst.util.ArrayData
@deprecated("Moved to org.apache.spark.sql.catalyst.util.DataTypeException", since = "1.6.0")
type DataTypeException = org.apache.spark.sql.catalyst.util.DataTypeException
@deprecated("Moved to org.apache.spark.sql.catalyst.util.DataTypeParser", since = "1.6.0")
type DataTypeParser = org.apache.spark.sql.catalyst.util.DataTypeParser
@deprecated("Moved to org.apache.spark.sql.catalyst.util.DataTypeParser", since = "1.6.0")
val DataTypeParser = org.apache.spark.sql.catalyst.util.DataTypeParser
@deprecated("Moved to org.apache.spark.sql.catalyst.util.GenericArrayData", since = "1.6.0")
type GenericArrayData = org.apache.spark.sql.catalyst.util.GenericArrayData
@deprecated("Moved to org.apache.spark.sql.catalyst.util.MapData", since = "1.6.0")
type MapData = org.apache.spark.sql.catalyst.util.MapData

}