我正在尝试使用Redshift Spectrum查询Hive视图,但这给了我这个错误:
SQL Error [500310] [XX000]: [Amazon](500310) Invalid operation: Assert
Details:
-----------------------------------------------
error: Assert
code: 1000
context: loc->length() > 5 && loc->substr(0,5) == "s3://" -
query: 12103470
location: scan_range_manager.cpp:272
process: padbmaster [pid=1769]
-----------------------------------------------;
是否可以从Redshift Spectrum查询Hive视图?我正在使用Hive Metastore(不是胶水数据目录)。
我想要一个视图,以限制对原始表的访问,该表具有有限的列和分区集。另外,由于我的原始表(Parquet数据)具有一些Map字段,所以我想做类似的事情以使从Redshift进行查询变得容易,因为Map字段在Redshift中处理起来有点复杂:
CREATE view my_view AS
SELECT event_time,event_properties['user-id'] as user_id,event_properties['product-id'] as product_id,year,month,day
FROM my_events
WHERE event_type = 'my-event' -- partition
我可以从Spectrum查询表my_events,但是这很混乱,因为属性是Map字段,而不是Struct,所以我需要在Redshift中将其爆炸成几行。
谢谢