简体   繁体   中英

IS NOT NULL in Cloudera-Impala

I'm new on Impala, and I'm trying to write a query where one field is SUM(X), and I want to put a condition on that field. When I used that query in MySQL, "HAVING SUM(X) IS NOT NULL" worked great - does anyone know what's the equivalent in Impala?

I tried a few ways, this is what I got:

  • "HAVING SUM(X) IS NOT NULL" --> AnalysisException: No matching function with signature: isnull(STRING).
  • "HAVING SUM(X) NOT NULL" --> AnalysisException: Syntax error in line 93: HAVING SUM(X) NOT NULL ^ Encountered: NULL Expected: BETWEEN, IN, LIKE, REGEXP, RLIKE CAUSED BY: Exception: Syntax error

If anyone has an answer for me I'd really appreciate it... Thank you!

Did you try IF conditional function?

HAVING IF(SUM(X) = NULL, FALSE, TRUE)

Documentation: http://www.cloudera.com/documentation/archive/impala/2-x/2-1-x/topics/impala_conditional_functions.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM