[
https://issues.apache.org/jira/browse/TAJO-1670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14632681#comment-14632681
]
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_r34954149
--- 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
+
+ // Meta Catalog
+ CAT_UPGRADE_REQUIRED = 901; // Migration
+ CAT_CANNOT_CONNECT = 902; // Cannot connect metadata
server
+
+ // Metadata Connector
+ TMC_NO_MATCHED_DATATYPE = 910; // No matched data type
between Tajo and connector
+
+ // Storage and Data Format
+ UNKNOWN_DATAFORMAT = 1001; // Unknown Data Format
+
+
+ CLIENT_CONNECTION_EXCEPTION = 1101; // SQLState: 08000 -
Client connection error
+ CLIENT_UNABLE_TO_ESTABLISH_CONNECTION = 1102; // SQLState: 08001 -
+ CLIENT_PROTOCOL_PROTOCOL_VIOLATION = 1103; // SQLState: ?
+
+ // Class values that begin with 0, 1, 2, 3, 4, A, B, C, D, E, F, G or H
+ // are called "standard-defined classes".
+
+
+
+ // 01 - Warning
+ // 02 - No Data
+ // 07 - Dynamic SQL Error
+ // 08 - Connection Exception
+ // 09 - Triggered Action Exception
+ // 0A - Feature Not Supported
+ // 0D - Invalid Target Type Specification
+ // 0F - Invalid Token
+ // 0K - Invalid RESIGNAL Statement
+ // 0N - SQL/XML mapping error
+ // 20 - Case Not Found for CASE Statement
+ // 21 - Cardinality Violation
+ // 22 - Data Exception
+ // 23 - Constraint Violation
+ // 24 - Invalid Cursor State
+ // 25 - Invalid Transaction State
+ // 26 - Invalid SQL Statement Identifier
+ // 28 - Invalid Authorization Specification
+ // 2D - Invalid Transaction Termination
+ // 2E - Invalid Connection Name
+ // 34 - Invalid Cursor Name
+ // 36 - Cursor Sensitivity Exception
+ // 38 - External Function Exception
+ // 39 - External Function Call Exception
+ // 3B - Invalid SAVEPOINT
+ // 40 - Transaction Rollback
+
+
+ // 44 - WITH CHECK OPTION Violation
+ // 46 - Java DDL
+ // 51 - Invalid Application State
+
+ // 53 - Invalid Operand or Inconsistent Specification
+ INSUFFICIENT_RESOURCE = 53000;
+ DISK_FULL = 53100;
+ OUT_OF_MEMORY = 53200;
+
+ // 54 - SQL or Product Limit Exceeded
+ PROGRAM_LIMIT_EXCEEDED = 54000;
+ STATEMENT_TOO_COMPLEX = 54001;
+ STRING_CONSTANT_TOOL_LONG = 54002;
+
+ TOO_MANY_TABLES = 54004;
+ TOO_MANY_COLUMNS = 54011;
+ TOO_MANY_ARGUMENTS = 54023;
+
+ // 55 - Object Not in Prerequisite State
+ // 56 - Miscellaneous SQL or Product Error
+ // 57 - Resource Not Available or Operator Intervention
+
+ // 58 - System Error
+ IO_ERROR = 58030;
+
+ // 5U - Utilities Table
+
+
+ // underlying system errors based on errno.h.
+ EPERM = 10001; // Operation not permitted
+ ENOENT = 10002; // No such file or directory
+ ESRCH = 10003; // No such process
+ EINTR = 10004; // Interrupted system call
+ EIO = 10005; // I/O error
+ ENXIO = 10006; // No such device or address
+ E2BIG = 10007; // Argument list too long
+ ENOEXEC = 10008; // Exec format error
+ EBADF = 10009; // Bad file number
+ ECHILD = 10010; // No child processes
+ EAGAIN = 10011; // Try again
+ ENOMEM = 10012; // Out of memory
+ EACCES = 10013; // Permission denied
+ EFAULT = 10014; // Bad address
+ ENOTBLK = 10015; // Block device required
+ EBUSY = 10016; // Device or resource busy
+ EEXIST = 10017; // File exists
+ EXDEV = 10018; // Cross-device link
+ ENODEV = 10019; // No such device
+ ENOTDIR = 10020; // Not a directory
+ EISDIR = 10021; // Is a directory
+ EINVAL = 10022; // Invalid argument
+ ENFILE = 10023; // File table overflow
+ EMFILE = 10024; // Too many open files
+ ENOTTY = 10025; // Not a typewriter
+ ETXTBSY = 10026; // Text file busy
+ EFBIG = 10027; // File too large
+ ENOSPC = 10028; // No space left on device
+ ESPIPE = 10029; // Illegal seek
+ EROFS = 10030; // Read-only file system
+ EMLINK = 10031; // Too many links
+ EPIPE = 10032; // Broken pipe
+ EDOM = 10033; // Math argument out of domain
of func
+ ERANGE = 10034; // Math result not representable
+;
+ EDEADLK = 10035; // Resource deadlock would occur
+ ENAMETOOLONG = 10036; // File name too long
+ ENOLCK = 10037; // No record locks available
+ ENOSYS = 10038; // Function not implemented
+ ENOTEMPTY = 10039; // Directory not empty
+ ELOOP = 10040; // Too many symbolic links
encountered
+ // EWOULDBLOCK = EAGAIN // Operation would block
--- End diff --
EWOULDBLOCK and EDEADLOCK are commented out.
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)