hive - Filtering null values in Scala -


i have hive table has null , empty values in columns. null values representation in table \n. trying select rows column not null in scala. have tried using

a. if (a.equals("\\n"))

b. if (!option(a).getorelse("").isempty)

c. using length(trim(a))

none of these options worked code either filter not work or rows excluded.

does has suggestions?

according https://cwiki.apache.org/confluence/display/hive/languagemanual+transform, hive's \n string, "\n", in java , hence in scala that's represented "\n" can matched using {scala.predef.string = java.lang.string}.matches("\\n") in following test:

val s = "\\n" println(s.matches("\\\\n")) // prints true 

if not work please provide information how accessing hive table , hive version can attempt replicate error.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -