Problem solved, partially. I rebooted my laptop to see if it makes any difference, and it actually did. Now, stop-tajo.sh doesn't show the error messages, and my changes are taking effect.
It seems like additional changes I made after reboot are being ignored again, though. (And, that's why I said it's partially solved.) On Fri, Nov 14, 2014 at 12:23 AM, Jaewoong Jung <[email protected]> wrote: > That's weird, because the stack trace shows the following: > > java.lang.NullPointerException > at org.apache.tajo.algebra.Expr$JsonSerDer.deserialize(Expr.java:127) > at org.apache.tajo.algebra.Expr$JsonSerDer.deserialize(Expr.java:119) > at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58) > at com.google.gson.Gson.fromJson(Gson.java:795) > at com.google.gson.Gson.fromJson(Gson.java:761) > at com.google.gson.Gson.fromJson(Gson.java:710) > at com.google.gson.Gson.fromJson(Gson.java:682) > at org.apache.tajo.algebra.JsonHelper.fromJson(JsonHelper.java:58) > at > org.apache.tajo.master.GlobalEngine.buildExpressionFromJson(GlobalEngine.java:194) > at org.apache.tajo.master.GlobalEngine.executeQuery(GlobalEngine.java:166) > > And, Expr.java:127 is precisely where my wrong JSON query is expected to fail. > > ---- > > BTW, I found that stop-tajo.sh prints out these messages. > > Stopping single TajoMaster > no master to stop > : > : > localhost: no worker to stop > > Is this normal? > > > On Fri, Nov 14, 2014 at 12:15 AM, Jihoon Son <[email protected]> wrote: >> The code lines where you made the above changes are in Expr.JsonSerder >> which is no longer used. >> Every class extended from Expr has a function of toJson() which is >> inherited from Expr. This function uses JsonHelper to generate json >> strings. >> In JsonHelper, you can find several adapters like OpType.JsonSerder. >> You may modify this class instead of Expr.JsonSerder. >> >> I hope this will be helpful for you. >> Jihoon >> >> 2014-11-14 16:52 GMT+09:00 Jaewoong Jung <[email protected]>: >> >>> On Thu, Nov 13, 2014 at 11:39 PM, Jihoon Son <[email protected]> wrote: >>> > Hi Jaewoong, >>> > thanks for your interest. >>> > Here are my answers. >>> > >>> > 1. You are right. We should make TajoCli support only SQL, and create a >>> new >>> > client for JSON. >>> > 2. Can you tell me what kinds of changes you made? In most cases, you can >>> > see the effect of your changes immediately, except when you modify the >>> > protocol buffers codes. >>> >>> It was a really simple change like this. >>> >>> * From >>> 127: String opType = >>> jsonObject.get(SERIALIZED_NAME_OF_OP_TYPE).getAsString(); >>> >>> * To >>> 127: JsonElement opTypeElement = >>> jsonObject.get(SERIALIZED_NAME_OF_OP_TYPE); >>> 128: if (opTypeElement == null) { >>> 129: throw new JsonParseException("Missing required field: " + >>> SERIALIZED_NAME_OF_OP_TYPE); >>> 130: } >>> 131: String opType = opTypeElement.getAsString(); >>> >>> FYI, I was trying to fix a bug where tsql just shows a dumb error >>> message, "ERROR: java.lang.NullPointerException" when an OpType field >>> is missing. >>> >>> No matter how I change the code, it throws a NullPointerException from >>> the same line of the code. I even tried adding a few blank lines above >>> 127, but the error trace shows that a NullPointerException was thrown >>> from the same line all the time. >>> >>> Strangely enough, if I make a typo to see whether my change gets >>> compiled, mvn stops with a proper error message. :( >>> >>> > >>> > Thanks, >>> > Jihoon >>> > >>> > 2014-11-14 16:13 GMT+09:00 Jaewoong Jung <[email protected]>: >>> > >>> >> 1. I found this issue (https://issues.apache.org/jira/browse/TAJO-826) >>> >> which has a comment that we should remove all JSON related part from >>> >> TajoCli. Does it mean that we want to make tsql support SQL queries >>> >> only and create a separate client dedicated for JSON queries? >>> >> >>> >> 2. While trying to fix a minor bug in JSON parsing, I found that any >>> >> of changes I made to Expr.java had no effect on tsql behavior. Does it >>> >> read a pre-compiled jar file from somewhere else? What should I do to >>> >> test my Expr changes? >>> >> >>> >> Thanks, >>> >> Jaewoong >>> >> >>> > >>> > >>> > >>> > -- >>> > Jihoon Son >>> > >>> > Database & Information Systems Group, >>> > Prof. Yon Dohn Chung Lab. >>> > Dept. of Computer Science & Engineering, >>> > Korea University >>> > 1, 5-ga, Anam-dong, Seongbuk-gu, >>> > Seoul, 136-713, Republic of Korea >>> > >>> > Tel : +82-2-3290-3580 >>> > E-mail : [email protected] >>> >> >> >> >> -- >> Jihoon Son >> >> Database & Information Systems Group, >> Prof. Yon Dohn Chung Lab. >> Dept. of Computer Science & Engineering, >> Korea University >> 1, 5-ga, Anam-dong, Seongbuk-gu, >> Seoul, 136-713, Republic of Korea >> >> Tel : +82-2-3290-3580 >> E-mail : [email protected]
