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

Java 8 + Maven Javadoc plugin: Error fetching URL -

android - How to delete or change the searchview icon inside the SearchView actionBar? -

c++ - Msgpack packing bools bug -