hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Luth <>
Subject Question regarding
Date Wed, 20 Mar 2013 18:52:39 GMT
Hello all,

I recently came across the following piece of code in

  *static* *{*

    StackTraceElement*[]* sTrace *=* *new* Exception*().*getStackTrace*();*




One question: What is this used for?

>From what I can tell its dead code.

Also there is similar code at

  static {
sTrace = new Exception
    String <>
className = sTrace[0].getClassName();
    try {
      SerDeUtils.registerSerDe(shortName(), Class.forName(className));
      // For backward compatibility: this class replaces the following
class.      SerDeUtils.registerSerDe("org.apache.hadoop.hive.serde.TestSerDe",
    } catch (Exception
e) {
      throw new RuntimeException

Which seems to do something, however I can't tell the difference between
the above and simple hard coding the class name; other than you can blindly
copy paste this code without changing that hard coded class name?

Any help in understanding this?



View raw message