hive - Is there a way to define replacement of one string to other in external table creation in greenplum.? -
i need create external table hdfs location. data having null instead of empty space few fields. if field length less 4 such fields, throwing error when selecting data. there way define replacement of such nulls empty space while creating table self.?
i trying in greenplum, tagged hive see can done such cases in hive.
you use serialization property mapping null string empty string.
create table if not exists abc ( ) row format delimited fields terminated '|' stored textfile tblproperties ("serialization.null.format"="")
in case when query hive empty value field , hdfs have "\n".
or
if want represented empty string instead of '\n', can using coalesce function:
insert overwrite tabname select null, coalesce(null,"") data_table;