Skip to content

Commit 66505cc

Browse files
committed
[SPARK-5123] Expose only one version of the data type APIs (i.e. remove the Java-specific API).
1 parent 14e3f11 commit 66505cc

File tree

160 files changed

+756
-2096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+756
-2096
lines changed

mllib/src/main/scala/org/apache/spark/ml/Pipeline.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ import scala.collection.mutable.ListBuffer
2121

2222
import org.apache.spark.Logging
2323
import org.apache.spark.annotation.AlphaComponent
24-
import org.apache.spark.ml.param.{Params, Param, ParamMap}
25-
import org.apache.spark.sql.{SchemaRDD, StructType}
24+
import org.apache.spark.ml.param.{Param, ParamMap}
25+
import org.apache.spark.sql.SchemaRDD
26+
import org.apache.spark.sql.types.StructType
2627

2728
/**
2829
* :: AlphaComponent ::

mllib/src/main/scala/org/apache/spark/ml/Transformer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import org.apache.spark.sql.SchemaRDD
2626
import org.apache.spark.sql.api.java.JavaSchemaRDD
2727
import org.apache.spark.sql.catalyst.analysis.Star
2828
import org.apache.spark.sql.catalyst.expressions.ScalaUdf
29-
import org.apache.spark.sql.catalyst.types._
29+
import org.apache.spark.sql.types._
3030

3131
/**
3232
* :: AlphaComponent ::

mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import org.apache.spark.mllib.regression.LabeledPoint
2626
import org.apache.spark.sql._
2727
import org.apache.spark.sql.catalyst.analysis.Star
2828
import org.apache.spark.sql.catalyst.dsl._
29+
import org.apache.spark.sql.types.{DoubleType, StructField, StructType}
2930
import org.apache.spark.storage.StorageLevel
3031

3132
/**

mllib/src/main/scala/org/apache/spark/ml/evaluation/BinaryClassificationEvaluator.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import org.apache.spark.annotation.AlphaComponent
2121
import org.apache.spark.ml._
2222
import org.apache.spark.ml.param._
2323
import org.apache.spark.mllib.evaluation.BinaryClassificationMetrics
24-
import org.apache.spark.sql.{DoubleType, Row, SchemaRDD}
24+
import org.apache.spark.sql.{Row, SchemaRDD}
25+
import org.apache.spark.sql.types.DoubleType
2526

2627
/**
2728
* :: AlphaComponent ::

mllib/src/main/scala/org/apache/spark/ml/feature/HashingTF.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import org.apache.spark.ml.UnaryTransformer
2222
import org.apache.spark.ml.param.{IntParam, ParamMap}
2323
import org.apache.spark.mllib.feature
2424
import org.apache.spark.mllib.linalg.{VectorUDT, Vector}
25-
import org.apache.spark.sql.catalyst.types.DataType
25+
import org.apache.spark.sql.types.DataType
2626

2727
/**
2828
* :: AlphaComponent ::

mllib/src/main/scala/org/apache/spark/ml/feature/StandardScaler.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import org.apache.spark.mllib.linalg.{Vector, VectorUDT}
2525
import org.apache.spark.sql._
2626
import org.apache.spark.sql.catalyst.analysis.Star
2727
import org.apache.spark.sql.catalyst.dsl._
28+
import org.apache.spark.sql.types.{StructField, StructType}
2829

2930
/**
3031
* Params for [[StandardScaler]] and [[StandardScalerModel]].

mllib/src/main/scala/org/apache/spark/ml/feature/Tokenizer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package org.apache.spark.ml.feature
2020
import org.apache.spark.annotation.AlphaComponent
2121
import org.apache.spark.ml.UnaryTransformer
2222
import org.apache.spark.ml.param.ParamMap
23-
import org.apache.spark.sql.{DataType, StringType, ArrayType}
23+
import org.apache.spark.sql.types.{DataType, StringType, ArrayType}
2424

2525
/**
2626
* :: AlphaComponent ::

mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import org.apache.spark.annotation.AlphaComponent
2424
import org.apache.spark.ml._
2525
import org.apache.spark.ml.param.{IntParam, Param, ParamMap, Params}
2626
import org.apache.spark.mllib.util.MLUtils
27-
import org.apache.spark.sql.{SchemaRDD, StructType}
27+
import org.apache.spark.sql.SchemaRDD
28+
import org.apache.spark.sql.types.StructType
2829

2930
/**
3031
* Params for [[CrossValidator]] and [[CrossValidatorModel]].

mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ import breeze.linalg.{DenseVector => BDV, SparseVector => BSV, Vector => BV}
2727

2828
import org.apache.spark.SparkException
2929
import org.apache.spark.mllib.util.NumericParser
30-
import org.apache.spark.sql.catalyst.annotation.SQLUserDefinedType
3130
import org.apache.spark.sql.catalyst.expressions.{GenericMutableRow, Row}
32-
import org.apache.spark.sql.catalyst.types._
31+
import org.apache.spark.sql.types._
3332

3433
/**
3534
* Represents a numeric vector, whose index type is Int and value type is Double.

project/MimaExcludes.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ object MimaExcludes {
6060
ProblemFilters.exclude[IncompatibleResultTypeProblem](
6161
"org.apache.spark.streaming.flume.sink.SparkAvroCallbackHandler." +
6262
"removeAndGetProcessor")
63+
) ++ Seq(
64+
// SPARK-5123 (SparkSQL data type change) - alpha component only
65+
ProblemFilters.exclude[IncompatibleResultTypeProblem](
66+
"org.apache.spark.ml.feature.HashingTF.outputDataType"),
67+
ProblemFilters.exclude[IncompatibleResultTypeProblem](
68+
"org.apache.spark.ml.feature.Tokenizer.outputDataType"),
69+
ProblemFilters.exclude[IncompatibleMethTypeProblem](
70+
"org.apache.spark.ml.feature.Tokenizer.validateInputType"),
71+
ProblemFilters.exclude[IncompatibleMethTypeProblem](
72+
"org.apache.spark.ml.classification.LogisticRegressionModel.validateAndTransformSchema"),
73+
ProblemFilters.exclude[IncompatibleMethTypeProblem](
74+
"org.apache.spark.ml.classification.LogisticRegression.validateAndTransformSchema")
6375
)
6476

6577
case v if v.startsWith("1.2") =>

0 commit comments

Comments
 (0)