我用的是jupyter笔记本和spark2.4.3。你知道吗
game_reviews = spark.read.format("csv").option("header", "true").load("./amazon_reviews_us_Video_Games_v1_00.tsv")
#reading is fine
game_reviews_2_columns =game_reviews.drop(
'marketplace','review_id','product_parent','product_title','product_category',
'helpful_votes' ,'total_votes','vine','verified_purchase','review_headline',
'review_body','review_date')
运行此代码
game_reviews_2_columns.columns
仍然提供所有列:
['marketplace\tcustomer_id\treview_id\tproduct_id\tproduct_parent\tproduct_title\tproduct_category\tstar_rating\thelpful_votes\ttotal_votes\tvine\tverified_purchase\treview_headline\treview_body\treview_date']
我做错什么了?你知道吗
它没有正确读取标题,它是一个列和标签的巨大字符串列表。你知道吗
我可以指定schema并包含它,但它工作得很好。你知道吗
相关问题 更多 >
编程相关推荐