Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
rddHotels.collect()
Expand
title작동결과

Image Added



SparkRDD 를 데이터셋으로

No Format
schema = StructType( [
    StructField('hotelIdx',LongType(),True),
    StructField('discount',LongType(),True),
    StructField('name',StringType(),True)
])

dfHotels = sqlContext.createDataFrame(rddHotels, schema)
Expand

Image Added


데이터 셋을 통해 SQL문사용하기

No Format
dfHotels.createOrReplaceTempView('tblHotel')


spark.sql('select * from tblHotel').collect()

...