You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tajo.apache.org by "Jihoon Son (JIRA)" <ji...@apache.org> on 2014/11/17 07:15:35 UTC

[jira] [Commented] (TAJO-1178) Some error messages for wrong JSON queries are not so much helpful

    [ https://issues.apache.org/jira/browse/TAJO-1178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14214324#comment-14214324 ] 

Jihoon Son commented on TAJO-1178:
----------------------------------

Hey [~jungjw], this is great work!
Your patch looks good and the error message is more helpful than before.
However, I think that we can improve this feature to be more helpful. 
Let me consider the following example.
{noformat}
default> {
  "IsDistinct": false,
  "Projections": [
    {
      "Expr": {
        "ColumnName": "n_nationkey"
      },
      "OpType": "Target"
    },
    {
      "Expr": {
        "IsDistinct": false,
        "Signature": "count",
        "FuncParams": [],
        "OpType": "CountRowsFunction"
      },
      "OpType": "Target"
    }
  ],
  "Expr": {
    "Groups": [
      {
        "GroupType": "OrdinaryGroup",
        "Dimensions": [
          {
            "ColumnName": "n_nationkey",
            "OpType": "Column"
          }
        ]
      }
    ],
    "Expr": {
      "Relations": [
        {
          "TableName": "nation",
          "OpType": "Relation"
        }
      ],
      "OpType": "RelationList"
    },
    "OpType": "Aggregation"
  },
  "OpType": "Projection"
}
ERROR: Field not found: OpType
{noformat}
As shown in this example, the error message is improved, but users are still hard to find where the error is caused from. 
So, IMHO, it would be better to print the error location together like stack traces.
For example, I improved the error message like this by adding some simple codes.
{noformat}
ERROR: Field not found: OpType
in: Projection
{noformat}
What do you think about it?
Please feel free to give any suggestions!

> Some error messages for wrong JSON queries are not so much helpful
> ------------------------------------------------------------------
>
>                 Key: TAJO-1178
>                 URL: https://issues.apache.org/jira/browse/TAJO-1178
>             Project: Tajo
>          Issue Type: Bug
>            Reporter: Jaewoong Jung
>            Assignee: Jaewoong Jung
>            Priority: Trivial
>         Attachments: TAJO-1178.Jung.111614.patch.txt
>
>
> When some required fields are missing, (e.g. OpType) tsql shows a dumb error message, "ERROR: java.lang.NullPointerException", which helps little in figuring out the problem.
> It should be more user-friendly like "Missing required filed: OpType".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)