在Apache Drill中查询十进制字段时出现异常

时间:2018-04-27 10:19:34

标签: parquet apache-drill

我正在尝试在apache钻取中运行以下查询。我使用以下查询

查询存储在镶木地板文件中的数据
select 
    pan, count(*) as number_of_transactions,
    terminal_id,
    sum((cast(SETTLE_AMOUNT_IMPACT as double) * -1) / 100) as settle_amount_impact
from 
    dfs.`/iswdata/storage/products/superswitch/parquet/transactions`
where 
    pan like '506126%' 
    and terminal_id like '1%' 
    and sink_node_name like ('SWTDB%') 
    and source_node_name not like ('SWTDBLsrc')
    and tran_completed = 1
    and tran_reversed = 0
    and tran_postilion_originated = 1
    and tran_type = '01'
    --and pan like '506126%0011'
group by 
    pan, terminal_id

我查询的数据架构如下

 post_tran_id LONG 2
 post_tran_cust_id :LONG
 settle_entity_id :INTEGER
 batch_nr : INTEGER  
 prev_post_tran_id : LONG
 next_post_tran_id : LONG 
 sink_node_name : STRING 
 tran_postilion_originated : DECIMAL 
 tran_completed : DECIMAL
 tran_amount_req : DECIMAL 
 tran_amount_rsp : DECIMAL 
 settle_amount_impact : DECIMAL 
 tran_cash_req : DECIMAL 
 tran_cash_rsp : DECIMAL 
tran_currency_code : STRING 
tran_tran_fee_req : DECIMAL 
tran_tran_fee_rsp : DECIMAL 
tran_tran_fee_currency_code : STRING 
tran_proc_fee_req : DECIMAL 
tran_proc_fee_rsp : DECIMAL 
tran_proc_fee_currency_code : STRING 
settle_amount_req : DECIMAL 
settle_amount_rsp : DECIMAL 
settle_cash_req : DECIMAL 
settle_cash_rsp : DECIMAL 
settle_tran_fee_req : DECIMAL 
settle_tran_fee_rsp : DECIMAL 
settle_proc_fee_req : DECIMAL 
settle_proc_fee_rsp : DECIMAL 
settle_currency_code : STRING

但是当我针对数据集运行查询时,我得到以下异常

SYSTEM ERROR: ClassCastException: org.apache.drill.exec.vector.NullableDecimal28SparseVector cannot be cast to org.apache.drill.exec.vector.VariableWidthVector

更重要的是,当我在select子句中包含一个十进制字段时,会发生同样的错误。 请问,我有什么遗漏或做错了,任何指针都将深受赞赏

亲切的问候

1 个答案:

答案 0 :(得分:3)

镶木地板表中的十进制值使用BINARY基本类型存储,但是目前,Drill不支持存储为二进制的小数。

它将在DRILL-6094中修复,并将在1.14版本中提供。