Open hamsunwoo opened 1 month ago
스키마를 명시해주니 해결
from pyspark.sql.types import StructType, StringType, FloatType, TimestampType, IntegerType, StructField
# 스키마 정의
schema = StructType([
StructField("num", IntegerType(), True),
StructField("comments", StringType(), True),
StructField("request_time", StringType(), True),
StructField("request_user", StringType(), True)
])
spark_df = spark.createDataFrame(df, schema=schema)