【发布时间】:2021-04-14 16:37:03
【问题描述】:
我有以下代码:
fact_item = (
spark.table('nn_team7_es.fact_table')
.union(spark.table('nn_squad7_cs.fact_table'))
.filter((f.col('date_key').between(start_py, end_py)) | (f.col('date_key').between(start_cy, end_cy)))
.filter(f.col('source') == 'tickets')
.filter(f.col('subtype') == 'item')
.filter(f.col('is_trx_ok') == 1)
.filter(f.col('is_return_item') == 0)
.groupby('iso_country_code',
'store_id',
'date_key',
'ticket_id',
'customer_id',
'item_id')
.agg(f.sum('item_quantity').alias('item_quantity'),
f.sum(f.col('item_extended_amount') - f.col('item_vat_amount')).alias('item_net_amount'))
.join(dim_dates, on=['date_key'], how='inner')
.join(dim_stores, on=['store_id'], how='inner')
.join(dim_products, on=['iso_country_code', 'item_id'], how='left')
.fillna(value='undefined', subset=['item_description', 'WGI', 'UWG', 'Family', 'Brand'])
)
display(fact_item)
当我运行此代码时,我收到以下错误:
SparkException:Future.get 中抛出异常:
如果我在没有最后一次显示的情况下运行代码,我不会收到任何错误。因为我以前在运行代码时从未见过它,所以我不明白为什么会得到它。有什么想法吗?
【问题讨论】: