逗号在将 table 从 pyspark 集群导出到 BigQuery 时为列中的特定值生成单独的行

Comma is generating separate rows for a particular value in a column while exporting table from pyspark cluster to BigQuery

我使用下面的代码将 spark df 导出到 bigquery

gcs_bucket = 'main'
bq_dataset = 'table'
bq_table = 'user'

Rules.write \
  .format("bigquery") \
  .option("table","{}.{}".format(bq_dataset, bq_table)) \
  .option("temporaryGcsBucket", gcs_bucket) \
  .mode('overwrite') \
  .save()

下面是我在集群中得到的输出

+-----------+----------+-------------------+------------------+
| antecedent|consequent|         confidence|              lift|
+-----------+----------+-------------------+------------------+
|[19, 6, 39]|      [44]|  0.418945963975984|10.602038775664845|
|[19, 6, 39]|      [35]|0.47298198799199465| 7.423073393311932|
|[19, 6, 39]|     [322]|   0.47631754503002|4.6520592549063995|
|[19, 6, 39]|     [308]| 0.4496330887258172| 5.856259667533207|
|[19, 6, 39]|     [345]| 0.5196797865243495|5.4970336458402285|

将上述 df 导出到 bigquery 时,我得到以下格式的 table。这是为什么?我该如何解决?

根据您的输出,antecedentconsequent 似乎是数组或 python 列表。这些被转换为 BigQuery's arrays

这就是 BigQuery UI 可视化数组(重复字段)的方式!
在经典版和主机版中 UI

同时,这只是给定工具如何表示/可视化某些数据类型的问题

例如,在 Goliath(Potens.io 套件的一部分)中,将表示为

能够深入到特定的数据单元并将其视为(例如)