你能告诉我如何处理ksql中的空值吗。我试图处理4种可能的方法,但没有得到解决。尝试了4种方法在ksql中用不同的值替换null,但给出了问题。
ksql> select PORTFOLIO_PLAN_ID from topic_stream_name; null
ksql> select COALESCE(PORTFOLIO_PLAN_ID,'N/A') from topic_stream_name; Can't find any functions with the name 'COALESCE'
ksql> select IFNULL(PORTFOLIO_PLAN_ID,'N/A') from topic_stream_name; Function 'IFNULL' does not accept parameters of types:[BIGINT, VARCHAR(STRING)]
ksql> select if(PORTFOLIO_PLAN_ID IS NOT NULL,PORTFOLIO_PLAN_ID,'N/A') FROM topic_stream_name; Can't find any functions with the name 'IF'
1条答案
按热度按时间4bbkushb1#
正如@cricket\u007引用的那样,在ksql中有一个以这种方式处理空值的开放票证。
您可以使用的一种解决方法是使用insert-into。它不是很优雅,当然也不像
COALESCE
:下面是处理
col3
: