今天写sql的时候遇到一个问题,记录一下。
我需要往一张临时表里面插入数据,具体代码如下所示:
insert into table hi_app_dc.dapd_cust_filecompl_sheet_new_temp1
select
b.jtsc_new_latn_id
,a.tele_area_id
,a.busi_nbr
,a.prod_inst_id
,a.prod_type
,a.accept_date
,a.accept_chnl
,a.sheet_id
,a.fault_filecompl_ctnt
,a.is_fcst_prcs_success
,a.sheet_state
,a.deal_mthd
,a.fault_filecompl_apr_small_clst_code
,nvl(a.fault_filecompl_rsn_small_clst_code_temp1,fault_filecompl_rsn_small_clst_code_temp2)
,a.fault_filecompl_deal_dur
,a.fault_filecompl_deal_ctnt
,a.handle_end_time
,a.lab_remarks
,a.sheet_type
,a.address
,a.longitude
,a.latitude
,a.enodebid_cell_id
from
hi_app_dc.dapd_cust_filecompl_sheet_new_temp11 a
left join
hi_dim_dc.dim_latn b on a.latn_id=b.region_id;
插入之前我单独执行了一次select语句,编译无异常能正常查询数据。但是但是,加上insert into再查询的时候就出问题了:
Error: Error while compiling statement: FAILED: UDFArgumentException void not found. (state=42000,code=40000)
![](https://img-blog.csdnimg.cn/img_convert/b1967e48f5575724e086645f4a568db9.png)
之前没遇到过这种错误,在网上也没找到相关的异常记录资料,于是根据提示去看了一下我取数表的字段,发现我的取数主表里面有一个字段类型是 void 型的,直觉告诉我问题多半是出在这里了。
desc hi_app_dc.dapd_cust_filecompl_sheet_new_temp11 ;
+--------------------------------------------+------------+----------+--+
| col_name | data_type | comment |
+--------------------------------------------+------------+----------+--+
| latn_id | string | |
| tele_area_id | string | |
| busi_nbr | string | |
| prod_inst_id | string | |
| prod_type | string | |
| accept_date | string | |
| accept_chnl | string | |
| sheet_id | string | |
| fault_filecompl_ctnt | string | |
| is_fcst_prcs_success | int | |
| sheet_state | string | |
| deal_mthd | string | |
| fault_filecompl_apr_small_clst_code | string | |
| fault_filecompl_rsn_small_clst_code_temp1 | string | |
| fault_filecompl_rsn_small_clst_code_temp2 | string | |
| fault_filecompl_deal_dur | bigint | |
| fault_filecompl_deal_ctnt | string | |
| handle_end_time | string | |
| lab_remarks | void | |---void类型,感觉有异常
| sheet_type | string | |
| address | string | |
| longitude | double | |
| latitude | double | |
| enodebid_cell_id | void | |
+--------------------------------------------+------------+----------+--+
最后更新了一下我的取数临时表,把 lab_remarks 的字段类型改成了 string ,然后再执行插入语句, 编译通过,执行成功!