@@ -191,13 +191,13 @@ class InsertIntoHiveTableSuite extends QueryTest with BeforeAndAfter {
191191 sql(" DROP TABLE hiveTableWithStructValue" )
192192 }
193193
194- test(" SPARK-5498:partition schema does not match table schema" ){
194+ test(" SPARK-5498:partition schema does not match table schema" ) {
195195 val testData = TestHive .sparkContext.parallelize(
196- (1 to 10 ).map(i => TestData (i, i.toString)))
196+ (1 to 10 ).map(i => TestData (i, i.toString))).toDF()
197197 testData.registerTempTable(" testData" )
198198
199199 val testDatawithNull = TestHive .sparkContext.parallelize(
200- (1 to 10 ).map(i => ThreeCloumntable (i, i.toString,null )))
200+ (1 to 10 ).map(i => ThreeCloumntable (i, i.toString,null ))).toDF()
201201
202202 val tmpDir = Files .createTempDir()
203203 sql(s " CREATE TABLE table_with_partition(key int,value string) PARTITIONED by (ds string) location ' ${tmpDir.toURI.toString}' " )
@@ -206,25 +206,25 @@ class InsertIntoHiveTableSuite extends QueryTest with BeforeAndAfter {
206206 // test schema the same between partition and table
207207 sql(" ALTER TABLE table_with_partition CHANGE COLUMN key key BIGINT" )
208208 checkAnswer(sql(" select key,value from table_with_partition where ds='1' " ),
209- testData.toDataFrame. collect.toSeq
209+ testData.collect.toSeq
210210 )
211211
212212 // test difference type of field
213213 sql(" ALTER TABLE table_with_partition CHANGE COLUMN key key BIGINT" )
214214 checkAnswer(sql(" select key,value from table_with_partition where ds='1' " ),
215- testData.toDataFrame. collect.toSeq
215+ testData.collect.toSeq
216216 )
217217
218218 // add column to table
219219 sql(" ALTER TABLE table_with_partition ADD COLUMNS(key1 string)" )
220220 checkAnswer(sql(" select key,value,key1 from table_with_partition where ds='1' " ),
221- testDatawithNull.toDataFrame. collect.toSeq
221+ testDatawithNull.collect.toSeq
222222 )
223223
224224 // change column name to table
225225 sql(" ALTER TABLE table_with_partition CHANGE COLUMN key keynew BIGINT" )
226226 checkAnswer(sql(" select keynew,value from table_with_partition where ds='1' " ),
227- testData.toDataFrame. collect.toSeq
227+ testData.collect.toSeq
228228 )
229229
230230 sql(" DROP TABLE table_with_partition" )
0 commit comments