Search code examples
data-structureshiveapache-pig

What exactly is the difference between Chararray and Bytearray in Pig and/or Hive?


I assume in Java char[] and byte[] should be able to be converted seamlessly and treated as the same right?


Solution

  • Well, pig chararray is internally represented by java.lang.String and pig bytearray is internally represented by org.apache.pig.data.DataByteArray which is a wrapper around byte[] with some convenient methods. As for the seamless cast - see this table https://pig.apache.org/docs/r0.7.0/piglatin_ref2.html#Cast+Operators and examples below