tajo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaewoong Jung <jun...@gmail.com>
Subject Re: A couple of questions about JSON query support
Date Fri, 14 Nov 2014 08:23:55 GMT
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 <ghoonson@gmail.com> 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 <jungjw@gmail.com>:
>
>> On Thu, Nov 13, 2014 at 11:39 PM, Jihoon Son <ghoonson@gmail.com> 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 <jungjw@gmail.com>:
>> >
>> >> 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 : jihoonson@korea.ac.kr
>>
>
>
>
> --
> 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 : jihoonson@korea.ac.kr

Mime
View raw message