正如bluephantom已经说过的那样,工会是要走的路。我只是在回答您的问题,以举一个pyspark示例:
# if not already created automatically, instantiate Sparkcontextspark = SparkSession.builder.getOrCreate()columns = ['id', 'dogs', 'cats']vals = [(1, 2, 0), (2, 0, 1)]df = spark.createDataframe(vals, columns)newRow = spark.createDataframe([(4,5,7)], columns)appended = df.union(newRow)appended.show()
也请查看databricks常见问题解答:https://kb.databricks.com/data/append-a-row-to-rdd-or-
dataframe.html
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)