@@ -755,289 +755,6 @@ class SQLContext private[sql](val sparkSession: SparkSession)
755755 sessionState.catalog.listTables(databaseName).map(_.table).toArray
756756 }
757757
758- // //////////////////////////////////////////////////////////////////////////
759- // //////////////////////////////////////////////////////////////////////////
760- // Deprecated methods
761- // //////////////////////////////////////////////////////////////////////////
762- // //////////////////////////////////////////////////////////////////////////
763-
764- /**
765- * @deprecated As of 1.3.0, replaced by `createDataFrame()`.
766- */
767- @ deprecated(" Use createDataFrame instead." , " 1.3.0" )
768- def applySchema (rowRDD : RDD [Row ], schema : StructType ): DataFrame = {
769- createDataFrame(rowRDD, schema)
770- }
771-
772- /**
773- * @deprecated As of 1.3.0, replaced by `createDataFrame()`.
774- */
775- @ deprecated(" Use createDataFrame instead." , " 1.3.0" )
776- def applySchema (rowRDD : JavaRDD [Row ], schema : StructType ): DataFrame = {
777- createDataFrame(rowRDD, schema)
778- }
779-
780- /**
781- * @deprecated As of 1.3.0, replaced by `createDataFrame()`.
782- */
783- @ deprecated(" Use createDataFrame instead." , " 1.3.0" )
784- def applySchema (rdd : RDD [_], beanClass : Class [_]): DataFrame = {
785- createDataFrame(rdd, beanClass)
786- }
787-
788- /**
789- * @deprecated As of 1.3.0, replaced by `createDataFrame()`.
790- */
791- @ deprecated(" Use createDataFrame instead." , " 1.3.0" )
792- def applySchema (rdd : JavaRDD [_], beanClass : Class [_]): DataFrame = {
793- createDataFrame(rdd, beanClass)
794- }
795-
796- /**
797- * Loads a Parquet file, returning the result as a `DataFrame`. This function returns an empty
798- * `DataFrame` if no paths are passed in.
799- *
800- * @group specificdata
801- * @deprecated As of 1.4.0, replaced by `read().parquet()`.
802- */
803- @ deprecated(" Use read.parquet() instead." , " 1.4.0" )
804- @ scala.annotation.varargs
805- def parquetFile (paths : String * ): DataFrame = {
806- if (paths.isEmpty) {
807- emptyDataFrame
808- } else {
809- read.parquet(paths : _* )
810- }
811- }
812-
813- /**
814- * Loads a JSON file (one object per line), returning the result as a `DataFrame`.
815- * It goes through the entire dataset once to determine the schema.
816- *
817- * @group specificdata
818- * @deprecated As of 1.4.0, replaced by `read().json()`.
819- */
820- @ deprecated(" Use read.json() instead." , " 1.4.0" )
821- def jsonFile (path : String ): DataFrame = {
822- read.json(path)
823- }
824-
825- /**
826- * Loads a JSON file (one object per line) and applies the given schema,
827- * returning the result as a `DataFrame`.
828- *
829- * @group specificdata
830- * @deprecated As of 1.4.0, replaced by `read().json()`.
831- */
832- @ deprecated(" Use read.json() instead." , " 1.4.0" )
833- def jsonFile (path : String , schema : StructType ): DataFrame = {
834- read.schema(schema).json(path)
835- }
836-
837- /**
838- * @group specificdata
839- * @deprecated As of 1.4.0, replaced by `read().json()`.
840- */
841- @ deprecated(" Use read.json() instead." , " 1.4.0" )
842- def jsonFile (path : String , samplingRatio : Double ): DataFrame = {
843- read.option(" samplingRatio" , samplingRatio.toString).json(path)
844- }
845-
846- /**
847- * Loads an RDD[String] storing JSON objects (one object per record), returning the result as a
848- * `DataFrame`.
849- * It goes through the entire dataset once to determine the schema.
850- *
851- * @group specificdata
852- * @deprecated As of 1.4.0, replaced by `read().json()`.
853- */
854- @ deprecated(" Use read.json() instead." , " 1.4.0" )
855- def jsonRDD (json : RDD [String ]): DataFrame = read.json(json)
856-
857- /**
858- * Loads an RDD[String] storing JSON objects (one object per record), returning the result as a
859- * `DataFrame`.
860- * It goes through the entire dataset once to determine the schema.
861- *
862- * @group specificdata
863- * @deprecated As of 1.4.0, replaced by `read().json()`.
864- */
865- @ deprecated(" Use read.json() instead." , " 1.4.0" )
866- def jsonRDD (json : JavaRDD [String ]): DataFrame = read.json(json)
867-
868- /**
869- * Loads an RDD[String] storing JSON objects (one object per record) and applies the given schema,
870- * returning the result as a `DataFrame`.
871- *
872- * @group specificdata
873- * @deprecated As of 1.4.0, replaced by `read().json()`.
874- */
875- @ deprecated(" Use read.json() instead." , " 1.4.0" )
876- def jsonRDD (json : RDD [String ], schema : StructType ): DataFrame = {
877- read.schema(schema).json(json)
878- }
879-
880- /**
881- * Loads an JavaRDD[String] storing JSON objects (one object per record) and applies the given
882- * schema, returning the result as a `DataFrame`.
883- *
884- * @group specificdata
885- * @deprecated As of 1.4.0, replaced by `read().json()`.
886- */
887- @ deprecated(" Use read.json() instead." , " 1.4.0" )
888- def jsonRDD (json : JavaRDD [String ], schema : StructType ): DataFrame = {
889- read.schema(schema).json(json)
890- }
891-
892- /**
893- * Loads an RDD[String] storing JSON objects (one object per record) inferring the
894- * schema, returning the result as a `DataFrame`.
895- *
896- * @group specificdata
897- * @deprecated As of 1.4.0, replaced by `read().json()`.
898- */
899- @ deprecated(" Use read.json() instead." , " 1.4.0" )
900- def jsonRDD (json : RDD [String ], samplingRatio : Double ): DataFrame = {
901- read.option(" samplingRatio" , samplingRatio.toString).json(json)
902- }
903-
904- /**
905- * Loads a JavaRDD[String] storing JSON objects (one object per record) inferring the
906- * schema, returning the result as a `DataFrame`.
907- *
908- * @group specificdata
909- * @deprecated As of 1.4.0, replaced by `read().json()`.
910- */
911- @ deprecated(" Use read.json() instead." , " 1.4.0" )
912- def jsonRDD (json : JavaRDD [String ], samplingRatio : Double ): DataFrame = {
913- read.option(" samplingRatio" , samplingRatio.toString).json(json)
914- }
915-
916- /**
917- * Returns the dataset stored at path as a DataFrame,
918- * using the default data source configured by spark.sql.sources.default.
919- *
920- * @group genericdata
921- * @deprecated As of 1.4.0, replaced by `read().load(path)`.
922- */
923- @ deprecated(" Use read.load(path) instead." , " 1.4.0" )
924- def load (path : String ): DataFrame = {
925- read.load(path)
926- }
927-
928- /**
929- * Returns the dataset stored at path as a DataFrame, using the given data source.
930- *
931- * @group genericdata
932- * @deprecated As of 1.4.0, replaced by `read().format(source).load(path)`.
933- */
934- @ deprecated(" Use read.format(source).load(path) instead." , " 1.4.0" )
935- def load (path : String , source : String ): DataFrame = {
936- read.format(source).load(path)
937- }
938-
939- /**
940- * (Java-specific) Returns the dataset specified by the given data source and
941- * a set of options as a DataFrame.
942- *
943- * @group genericdata
944- * @deprecated As of 1.4.0, replaced by `read().format(source).options(options).load()`.
945- */
946- @ deprecated(" Use read.format(source).options(options).load() instead." , " 1.4.0" )
947- def load (source : String , options : java.util.Map [String , String ]): DataFrame = {
948- read.options(options).format(source).load()
949- }
950-
951- /**
952- * (Scala-specific) Returns the dataset specified by the given data source and
953- * a set of options as a DataFrame.
954- *
955- * @group genericdata
956- * @deprecated As of 1.4.0, replaced by `read().format(source).options(options).load()`.
957- */
958- @ deprecated(" Use read.format(source).options(options).load() instead." , " 1.4.0" )
959- def load (source : String , options : Map [String , String ]): DataFrame = {
960- read.options(options).format(source).load()
961- }
962-
963- /**
964- * (Java-specific) Returns the dataset specified by the given data source and
965- * a set of options as a DataFrame, using the given schema as the schema of the DataFrame.
966- *
967- * @group genericdata
968- * @deprecated As of 1.4.0, replaced by
969- * `read().format(source).schema(schema).options(options).load()`.
970- */
971- @ deprecated(" Use read.format(source).schema(schema).options(options).load() instead." , " 1.4.0" )
972- def load (
973- source : String ,
974- schema : StructType ,
975- options : java.util.Map [String , String ]): DataFrame = {
976- read.format(source).schema(schema).options(options).load()
977- }
978-
979- /**
980- * (Scala-specific) Returns the dataset specified by the given data source and
981- * a set of options as a DataFrame, using the given schema as the schema of the DataFrame.
982- *
983- * @group genericdata
984- * @deprecated As of 1.4.0, replaced by
985- * `read().format(source).schema(schema).options(options).load()`.
986- */
987- @ deprecated(" Use read.format(source).schema(schema).options(options).load() instead." , " 1.4.0" )
988- def load (source : String , schema : StructType , options : Map [String , String ]): DataFrame = {
989- read.format(source).schema(schema).options(options).load()
990- }
991-
992- /**
993- * Construct a `DataFrame` representing the database table accessible via JDBC URL
994- * url named table.
995- *
996- * @group specificdata
997- * @deprecated As of 1.4.0, replaced by `read().jdbc()`.
998- */
999- @ deprecated(" Use read.jdbc() instead." , " 1.4.0" )
1000- def jdbc (url : String , table : String ): DataFrame = {
1001- read.jdbc(url, table, new Properties )
1002- }
1003-
1004- /**
1005- * Construct a `DataFrame` representing the database table accessible via JDBC URL
1006- * url named table. Partitions of the table will be retrieved in parallel based on the parameters
1007- * passed to this function.
1008- *
1009- * @param columnName the name of a column of integral type that will be used for partitioning.
1010- * @param lowerBound the minimum value of `columnName` used to decide partition stride
1011- * @param upperBound the maximum value of `columnName` used to decide partition stride
1012- * @param numPartitions the number of partitions. the range `minValue`-`maxValue` will be split
1013- * evenly into this many partitions
1014- * @group specificdata
1015- * @deprecated As of 1.4.0, replaced by `read().jdbc()`.
1016- */
1017- @ deprecated(" Use read.jdbc() instead." , " 1.4.0" )
1018- def jdbc (
1019- url : String ,
1020- table : String ,
1021- columnName : String ,
1022- lowerBound : Long ,
1023- upperBound : Long ,
1024- numPartitions : Int ): DataFrame = {
1025- read.jdbc(url, table, columnName, lowerBound, upperBound, numPartitions, new Properties )
1026- }
1027-
1028- /**
1029- * Construct a `DataFrame` representing the database table accessible via JDBC URL
1030- * url named table. The theParts parameter gives a list expressions
1031- * suitable for inclusion in WHERE clauses; each one defines one partition
1032- * of the `DataFrame`.
1033- *
1034- * @group specificdata
1035- * @deprecated As of 1.4.0, replaced by `read().jdbc()`.
1036- */
1037- @ deprecated(" Use read.jdbc() instead." , " 1.4.0" )
1038- def jdbc (url : String , table : String , theParts : Array [String ]): DataFrame = {
1039- read.jdbc(url, table, theParts, new Properties )
1040- }
1041758}
1042759
1043760/**
0 commit comments