Hi, you can alter your SQL like the new SQL below. It can work around temporarily. Maybe there was something limitation of the char type length in OLAP query expression.
Select case substring(PRODUCT_PENETRANCE_LEVEL, 1) when ‘1’ then ‘hello' when ‘2' then ‘Kylie' else ’sorry' end from TAGS_MBR_PRODUCTPENETRANCE_D ---------------------------------------------- 陆国圣 / Guosheng Lu 软件工程师 / Software Engineer http://kyligence.io <http://kyligence.io/> 在 2019/10/16 上午9:45,“Yaqian Zhang”<yaqian_zh...@126.com> 写入: Hi ZhenDong: I reproduced this error, and it’s likely with https://issues.apache.org/jira/browse/KYLIN-4166 <https://issues.apache.org/jira/browse/KYLIN-4166>. I think we should fix it in future version. > 在 2019年10月15日,18:02,Zhen Dong <dev...@163.com> 写道: > > 当我采用以下标准sql在kylin执行时执行正确,sql如下: > > select > > case 1 when 1 then 'hello' > > when 2 then 'Kylie' > > else 'sorry' end > > from TAGS_MBR_PRODUCTPENETRANCE_D > > <PastedGraphic-2.png> > > > 基于这个case when条件判断特性,我们的TAGS_MBR_PRODUCTPENETRANCE_D库中有一个通过hive同步类型为varchar类型的字段PRODUCT_PENETRANCE_LEVEL,按照上面的流程,我们希望通过PRODUCT_PENETRANCE_LEVEL字段进行条件判断输出不同的值。 > > SQL改为下面情况 > > select > > case PRODUCT_PENETRANCE_LEVEL when '1' then ‘hello' > > when ‘2' then ‘Kylie' > > else ’sorry' end > > from TAGS_MBR_PRODUCTPENETRANCE_D > > 在这种情况下,最坏的情况就是进入else块输出sorry。但是我们在web页面中得到的却是空值,就如下面的情况: > > <PastedGraphic-3.png> > > > 请问这是什么原因,实在摸不清头脑,kylin版本为:2.6.3