Inceptor Parse error [Error 1110] line 102,24 SQL问题
今天遇到一个SQL跑不通的问题:
去掉cast as
去掉round
最初以为是Inceptor不兼容ORACLE语句Cast as 导致的,做的以下测试
发现都能跑通,说明Cast as语句在Inceptor中能正常使用。
然后仔细检查Sql语句
最初语句报错信息如下:
只执行前半部分,去掉left join能正常运行,验证了Cast as没错
加上left join后又报错:
最后发现,131行少写一个英文逗号,加上后问题解决。
原始SQL
with `__all_dim__` as (
select
*
from (
select
from_unixtime(
unix_timestamp(`__bts__`) -1,
'yyyy-MM-dd HH:mm:ss'
) as `__bts__`
from (
select
concat_ws(' ', `d`.`date`, `t`.`time_of_day`) as `__bts__`
from `ecmp`.`dim_date` as `d`
left join `ecmp`.`dim_time_of_day` as `t` on 1 = 1
where
`d`.`date` >= '2019-12-24'
and `d`.`date` <= '2019-12-25'
) as `__bts___tp1`
where
`__bts__` > '2019-12-24 00:00:00'
and `__bts__` <= '2019-12-25 00:00:00'
and second(`__bts__`) = 0
and minute(`__bts__`) = 0
and hour(`__bts__`) = 0
and pmod(day(`__bts__`), 1) = 0
) as `__time_model__`
cross join (
select
`dd_60139`.`ci_pk` as `ci_pk`,
`dd_60139`.`ci_id` as `ci_id`,
`dd_60139`.`ci_code` as `ci_code`,
`dd_60139`.`ci_name` as `ci_name`,
`dd_60139`.`bs_pk` as `bs_pk`,
`dd_60139`.`aps_pk` as `aps_pk`,
`dd_60139`.`tenant_pk` as `tenant_pk`,
`dd_60139`.`ts_pk` as `ts_pk`,
`dd_60139`.`oc_pk` as `oc_pk`,
`dd_60139`.`bs_id` as `bs_id`,
`dd_60139`.`aps_id` as `aps_id`,
`dd_60139`.`tenant_id` as `tenant_id`,
`dd_60139`.`oc_id` as `oc_id`,
`dd_60139`.`ts_id` as `ts_id`,
`dd_60139`.`tenant_name` as `tenant_name`,
`dd_60139`.`oc_name` as `oc_name`,
`dd_60139`.`aps_dname` as `aps_dname`,
`dd_60139`.`bs_name` as `bs_name`,
`dd_60139`.`ts_name` as `ts_name`
from `ecmp`.`dim_ci` as `dd_60139`
) as `ci_pk`
cross join (
select
'运维A角' as incident_acceptor_role
from system.dual
union all
select
'运维B角' as incident_acceptor_role
from system.dual
union all
select
'运维1.5线' as incident_acceptor_role
from system.dual
union all
select
'其他' as incident_acceptor_role
from system.dual
) as `incident_acceptor_role`
)
,`t` as (
select
`ci_pk`,
`accept_incident_count`,
`aps_pk`,
`incident_acceptor_role`,
rank() over(
partition by `aps_pk`,
`incident_acceptor_role`
order by
`accept_incident_count` DESC
) as `accept_incident_count_rank`,
rank() over(
partition by `aps_pk`,
`incident_acceptor_role`
order by
`accept_incident_count` ASC
) as `__inverse_rank__`
from (
select
`aps_pk`,
`incident_acceptor_role`,
`ci_pk`,
accept_incident_count as accept_incident_count
from `ecmp`.dws_ci_b00001t01_nd01_003
where
accept_incident_count is not null
and `__bts__` >= '2019-12-24 00:00:00'
AND `__bts__` <= '2019-12-24 23:59:59'
) as `t0`
)
--insert into `ecmp`.`dws_ci_b00001t04_nd01_018`(`__bts__`,`__cts__`,`accept_incident_count`,`accept_incident_count_rank`,`accept_incident_count_win_rate`,`aps_dname`,`aps_id`,`aps_pk`,`bs_id`,`bs_name`,`bs_pk`,`ci_code`,`ci_id`,`ci_name`,`ci_pk`,`incident_acceptor_role`,`oc_id`,`oc_name`,`oc_pk`,`tenant_id`,`tenant_name`,`tenant_pk`,`ts_id`,`ts_name`,`ts_pk`) select
`__all_dim__`.`ci_pk` as `ci_pk`,
`__all_dim__`.`incident_acceptor_role` as `incident_acceptor_role`,
CAST(round(nvl(`accept_incident_count`, 0), 0) as INT) as `accept_incident_count`,
CAST(round(`accept_incident_count_rank`, 0) as INT) as `accept_incident_count_rank`,
CAST(round(`accept_incident_count_win_rate`, 1) as DOUBLE) as `accept_incident_count_win_rate`,
`__all_dim__`.`ci_id` as `ci_id`,
`__all_dim__`.`ci_code` as `ci_code`,
`__all_dim__`.`ci_name` as `ci_name`,
`__all_dim__`.`bs_pk` as `bs_pk`,
`__all_dim__`.`aps_pk` as `aps_pk`,
`__all_dim__`.`tenant_pk` as `tenant_pk`,
`__all_dim__`.`ts_pk` as `ts_pk`,
`__all_dim__`.`oc_pk` as `oc_pk`,
`__all_dim__`.`bs_id` as `bs_id`,
`__all_dim__`.`aps_id` as `aps_id`,
`__all_dim__`.`tenant_id` as `tenant_id`,
`__all_dim__`.`oc_id` as `oc_id`,
`__all_dim__`.`ts_id` as `ts_id`,
`__all_dim__`.`tenant_name` as `tenant_name`,
`__all_dim__`.`oc_name` as `oc_name`,
`__all_dim__`.`aps_dname` as `aps_dname`,
`__all_dim__`.`bs_name` as `bs_name`,
`__all_dim__`.`ts_name` as `ts_name`,
CAST(SYSDATE as STRING) as `__cts__`,
`__all_dim__`.`__bts__` as `__bts__`
from `__all_dim__`
left join (
select
'2019-12-24 23:59:59' as `__bts__`,
`accept_incident_count`,
`accept_incident_count_rank`,
`accept_incident_count_win_rate`,//这一行
CAST(coalesce(`tp1`.`aps_pk`) as STRING) as `aps_pk`,
CAST(coalesce(`tp1`.`ci_pk`) as STRING) as `ci_pk`,
CAST(coalesce(`tp1`.`incident_acceptor_role`) as STRING) as `incident_acceptor_role`
from (
select
`t`.`ci_pk`,
`t`.`aps_pk`,
`t`.`incident_acceptor_role`,
`t`.`accept_incident_count`,
`t`.`accept_incident_count_rank`,
if(`c`.ct = 1,null,(`__inverse_rank__` -1) /(`c`.ct -1) * 100) as `accept_incident_count_win_rate`
from `t`
left join (
select
`aps_pk`,
`incident_acceptor_role`,
count(*) as `ct`
from `t`
group by
`aps_pk`,
`incident_acceptor_role`
) as `c`
on 1 = 1
and `t`.`aps_pk` = `c`.`aps_pk`
and `t`.`incident_acceptor_role` = `c`.`incident_acceptor_role`
) as `tp1`
) as `__dws__`
on `__all_dim__`.`__bts__` = `__dws__`.`__bts__`
and `__all_dim__`.`ci_pk` = `__dws__`.`ci_pk`
and `__all_dim__`.`incident_acceptor_role` = `__dws__`.`incident_acceptor_role`
Inceptor Parse error [Error 1110] line 102,24 SQL问题的更多相关文章
- Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止
1.错误描述 严重: Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "< ...
- mysql报错:Cause: java.sql.SQLException: sql injection violation, syntax error: ERROR. pos 39, line 2, column 24, token CLOSE
因为close是mysql关键字 -- ::, DEBUG (BaseJdbcLogger.java:)- ==> Preparing: , -- ::, INFO (XmlBeanDefini ...
- Laravel Predis Error while reading line from the server.
问题 Laravel说明文档中的 Redis 发布与订阅案例,命令行运行php artisan redis:subscribe 到60s自动断开并报错 [Predis\Connection\Conne ...
- Faster RCNN 运行自己的数据,刚开始正常,后来就报错: Index exceeds matrix dimensions. Error in ori_demo (line 114) boxes_cell{i} = [boxes(:, (1+(i-1)*4):(i*4)), scores(:, i)];
function script_faster_rcnn_demo() close all; clc; clear mex; clear is_valid_handle; % to clear init ...
- make module失败的原因cc1: error: unrecognized command line option “-m64
cc1: error: unrecognized command line option "-m64"cc1: error: unrecognized command line o ...
- laravel redis Error while reading line from the server.
代码运行一段时间后,会报下面的错误. [Predis\Connection\ConnectionException] Error while reading line from the server. ...
- linux下安装QT5:error: unrecognized command line option ‘-fuse-ld=gold’
安装qt时在执行./configure时报错:error: unrecognized command line option '-fuse-ld=gold' 这个错误是qt的一个bug. 在装有gol ...
- 编辑sass报错:error style.scss (Line 3: Invalid GBK character "\xE5")解决办法
cmd.exe /D /C call C:/Ruby23-x64/bin/scss.bat --no-cache --update header.scss:header.css error heade ...
- qt opencv编译错误 /usr/local/lib/libopencv_imgcodecs.so.3.1:-1: error: error adding symbols: DSO missing from command line
转载自:http://tbfungeek.github.io/2016/03/05/Opencv-%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B%E4%B8%AD%E5%87 ...
随机推荐
- 小米11和iPhone11 哪个好
小米11:搭载最新一代三星的AMOLED屏幕,120Hz屏幕刷新iPhone11采用6.1英寸的分辨率1792828的LCD屏幕小米手机爆降800 优惠力度空前机会不容错过https://www.xi ...
- jQuery中toggle与slideToggle以及fadeToggle的显示、隐藏方法的比较
1.区别 ①动画效果的比较: toggle:直接显示.隐藏,如果有[时间参数]且[匹配的元素有宽度属性],则动态效果为左上角-右下角拉卷效果,透明度0-1之间的变化:若有时间参数但是[匹配的元素没有宽 ...
- PHP 判断手机端还是web端
function isMobile(){ // 如果有HTTP_X_WAP_PROFILE则一定是移动设备 if (isset ($_SERVER['HTTP_X_WAP_PROFILE'])) re ...
- 十八般武艺玩转GaussDB(DWS)性能调优:路径干预
摘要:路径生成是表关联方式确定的主要阶段,本文介绍了几个影响路径生成的要素:cost_param, scan方式,join方式,stream方式,并从原理上分析如何干预路径的生成. 一.cost模型选 ...
- 【JavaWeb】jQuery 基础
jQuery 基础 介绍 顾名思义,它是 JavaScript 和 查询,是辅助 JavaScript 开发的类库. 它的核心思想是 write less, do more. 所以它实现了很多浏览器的 ...
- 剑指Offer58-左转字符串
题目 汇编语言中有一种移位指令叫做循环左移(ROL),现在有个简单的任务,就是用字符串模拟这个指令的运算结果.对于一个给定的字符序列S,请你把其循环左移K位后的序列输出.例如,字符序列S=" ...
- RPC 是通信协议吗 ?→ 我们来看下它的演进过程
开心一刻 一实习小护士给我挂针,拿着针在我胳膊上扎了好几针也没找到血管 但这位小姑娘真镇定啊,表情严肃认真,势有不扎到血管不罢休的意思 十几针之后,我忍着剧痛,带着敬畏的表情问小护士:你这针法跟容嬷嬷 ...
- 转 Jmeter测试实践:文件上传接口
Jmeter测试实践:文件上传接口 1.打开jmeter4.0,新建测试计划,添加线程组.根据实际情况配置线程属性. 2.添加HTTP请求. Basic部分修改如下: Advanced部分我做任何 ...
- Android N selectQualifiedNetwork分析
前言: 参考:Android N wifi auto connect流程分析 后续 Android 8.0/9.0 wifi 自动连接评分机制 分析 前面说了,handleScanResults会去调 ...
- ubuntu安装mysql5.6
安装mysql5.6在ubuntu上安装mysql5.6的版本 1.添加mysql5.6的源 sudo apt-get install software-properties-common sudo ...