[
https://issues.apache.org/jira/browse/TAJO-948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14135516#comment-14135516
]
ASF GitHub Bot commented on TAJO-948:
-------------------------------------
Github user hyunsik commented on a diff in the pull request:
https://github.com/apache/tajo/pull/142#discussion_r17604055
--- Diff:
tajo-core/src/main/java/org/apache/tajo/engine/planner/PreLogicalPlanVerifier.java
---
@@ -254,6 +254,10 @@ public Expr visitInsert(Context context, Stack<Expr>
stack, Insert expr) throws
}
TableDesc table = catalog.getTableDesc(qualifiedName);
+ if (table == null) {
+ context.state.addVerification("It seems target table doesn't
exist");
--- End diff --
The bug fix looks correct. But, I have one suggestion about the message.
The other similar cases use ```relation "%s" does not exist```. Could you
change the message for consistency?
You can see the similar case at
https://github.com/eminency/tajo/blob/TAJO-948/tajo-core/src/main/java/org/apache/tajo/engine/planner/PreLogicalPlanVerifier.java#L134
> 'INSERT INTO' statement to non existence table casuses NPE.
> -----------------------------------------------------------
>
> Key: TAJO-948
> URL: https://issues.apache.org/jira/browse/TAJO-948
> Project: Tajo
> Issue Type: Bug
> Components: planner/optimizer
> Reporter: Hyunsik Choi
> Assignee: Jongyoung Park
> Priority: Minor
> Labels: newbie
> Fix For: 0.9.0
>
>
> See the title. In the following example, lineitem_8 does not exist in
> catalog. In this case, if we use INSERT INTO statement, NPE will be caused.
> This is a logical validator bug.
> {noformat}
> default> insert into lineitem_8 SELECT L_ORDERKEY, L_PARTKEY, L_SUPPKEY,
> L_LINENUMBER, L_QUANTITY, L_EXTENDEDPRICE, L_DISCOUNT, L_TAX, L_LINESTATUS,
> L_SHIPDATE, L_COMMITDATE, L_RECEIPTDATE, L_SHIPINSTRUCT, L_SHIPMODE,
> L_COMMENT, L_RETURNFLAG FROM LINEITEM;
> ERROR: java.lang.NullPointerException
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)