[
https://issues.apache.org/jira/browse/TAJO-1670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14632680#comment-14632680
]
ASF GitHub Bot commented on TAJO-1670:
--------------------------------------
Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/621#discussion_r34954147
--- Diff: tajo-common/src/main/proto/errors.proto ---
@@ -0,0 +1,327 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package tajo.error;
+option java_package = "org.apache.tajo.error";
+
+import "stacktrace.proto";
+
+// Unstable - this is still evolving.
+
+enum ResultCode {
+ // Class
+ // 00 - Successful Completion
+ OK = 0;
+
+ WARNING = 100; // Warning
+
+ // General Errors
+ INTERNAL_ERROR = 201; // Error caused by internal bugs
(See also TajoInternalException.java)
+ NOT_IMPLEMENTED = 202; // Planned, but not implemented yet.
+ FEATURE_NOT_SUPPORTED = 203; // SQLState: 0A000 - Unsupported
feature (usually for unreasonable feature)
+ INVALID_RPC_CALL = 204; // When invalid RPC call is invoked
(e.g., wrong message and absent fields)
+
+ // Query Management and Scheduler
+ NO_SUCH_QUERYID = 300; // No query id in TajoMaster
+ NO_DATA = 301; // No data due to query fail or
error
+ INCOMPLETE_QUERY = 302; // It occurs when a client requests
something of a completed query.
+
+ // Session
+ INVALID_SESSION = 401; // Session already was invalid
+ NO_SUCH_SESSION_VARIABLE = 402; // Session variable not found
+ INVALID_SESSION_VARIABLE = 403; // Session variable is invalid
(type mismatch or out of range)
+
+ // Data Exception (SQLState Class - 22)
+ DIVISION_BY_ZERO = 451; // SQLState: 22012 - Division by
zero
+
+
+ // Section: Class 42 - Syntax Error or Access Rule Violation
+ SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION = 601; // SQLState: 42000
+ SYNTAX_ERROR = 602; // SQLState: 42601
+ INSUFFICIENT_PRIVILEGE = 603; // SQLState: 42501
+
+ UNDEFINED_TABLESPACE = 500; // ?
+ UNDEFINED_DATABASE = 501; // ?
+ UNDEFINED_SCHEMA = 502; // ?
+ UNDEFINED_TABLE = 503; // ?
+ UNDEFINED_COLUMN = 504; // SQLState: 42703
+ UNDEFINED_FUNCTION = 505; // SQLState: 42883
+ UNDEFINED_INDEX = 506; // ?
+ UNDEFINED_INDEX_NAME = 507; // ?
+ UNDEFINED_PARTITION = 508; // ?
+ UNDEFINED_PARTITION_METHOD = 509; // ?
+ UNDEFINED_OPERATOR = 510; // SQLState: 42883
(=UNDEFINED_FUNCTION)
+
+ DUPLICATE_TABLESPACE = 510;
+ DUPLICATE_DATABASE = 511; // SQLState: 42P04
+ DUPLICATE_SCHEMA = 512; // SQLState: 42P06
+ DUPLICATE_TABLE = 513; // SQLState: 42P07
+ DUPLICATE_COLUMN = 514; // SQLState: 42701
+ DUPLICATE_ALIAS = 515; // SQLState: 42712
+ DUPLICATE_FUNCTION = 516; // SQLState: 42723
+ DUPLICATE_INDEX = 517; // SQLState: ?
+ DUPLICATE_PARTITION = 518; // SQLState: ?
+
+ AMBIGUOUS_TABLE = 521; // ?
+ AMBIGUOUS_COLUMN = 522; // SQLState: 42702;
+ AMBIGUOUS_FUNCTION = 523; // SQLState: 42725;
+
+ CANNOT_CAST = 604; // SQLState: 42846 - Cast
from source type to target type is not supported.
+ GROUPING_ERROR = 605; // SQLState: 42803
+ WINDOWING_ERROR = 606; // SQLState: 42P20 - PgSQL
implementation-defined
+ INVALID_RECURSION = 607; // SQLState: 42P19 - PgSQL
implementation-defined
+ SET_OPERATION_SCHEMA_MISMATCH = 608; // SQLState: 42601
(=SYNTAX_ERROR)
+ SET_OPERATION_DATATYPE_MISMATCH = 609; // SQLState: 42601
(=SYNTAX_ERROR)
+ INVALID_FOREIGN_KEY = 621; // SQLState: 42830
+ INVALID_NAME = 622; // SQLState: 42602
+ INVALID_COLUMN_DEFINITION = 631; // SQLState: 42611
+ NAME_TOO_LONG = 623; // SQLState: 42622
+ RESERVED_NAME = 624; // SQLState: 42939
+ DATATYPE_MISMATCH = 625; // SQLState: 42804
+ INDETERMINATE_DATATYPE = 626; // SQLState: 42P18 - PgSQL
implementation -defined
+
+
+
+ // Expressions
+ INVALID_EXPRESSION = 701;
+ INVALID_CAST = 702;
+ INVALID_DATATYPE = 703;
+
+ //NUMERIC_OVERFLOW = 803; // Numeric value overflow
+ //VALUE_LARGER_THAN_PRECISION = 804; // Value larger than
column precision
--- End diff --
What is the meaning of these commented out codes? If they are TODOs, please
add some comments.
> Refactor client errors and exceptions
> -------------------------------------
>
> Key: TAJO-1670
> URL: https://issues.apache.org/jira/browse/TAJO-1670
> Project: Tajo
> Issue Type: Sub-task
> Components: Java Client, TajoMaster, Worker
> Reporter: Hyunsik Choi
> Assignee: Hyunsik Choi
> Fix For: 0.11.0
>
>
> The main objective is to refactor the error and exception system in client
> side and its connected parts like TajoMaster.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)