[prev in list] [next in list] [prev in thread] [next in thread] 

List:       avro-dev
Subject:    Fwd: Handling empty string in avro file
From:       Jegan <jeganbaskar () gmail ! com>
Date:       2016-03-22 2:54:13
Message-ID: CAHScKX1xZZ4w_EVBUsxcoasEM8UWSLbvWtatxx6eZM9_5uLOBg () mail ! gmail ! com
[Download RAW message or body]


Hi All,

I am using avro file format to load the data in to hive and source system
is Teradata.  In the source i have a both NULL and empty string. But when
it landed in the hive its storing both as NULL only. For example

{
  "type" : "record",
  "name" : "Personal",
  "fields" : [ {
    "name" : "Id",
    "type" : [ "null", "int" ]
  }, {
    "name" : "name",
    "type" : [ "null", "string" ]
  }, {
    "name" : "age",
    "type" : [ "null", "int" ]
  }, {
    "name" : "zipcode",
    "type" : [ "null", "int" ]         --> have tried as "type" :int,
"default" : ""
  }]
}

Since integer value is empty in source, by above one comes as null as
defined i tried give "type" : int as well and comes as NULL.

Is there any way where i can get the empty string as it is in source.
Because in my landing hive table should contain both NULL and emptystring
and it has a different meaning for us . Your help would be appreciable.

Thank you

Regards,
Jegan


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic