blob: cfb7242c965f7fe5e58b5cdc66bb7d20315e44f3 [file] [log] [blame]
/**
* 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.
// 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". This is borrowed from PostgreSQL and IBM DB2.
// 00 - Successful Completion
// 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
// 42 - Syntax Error or Access Rule Violation
// 44 - WITH CHECK OPTION Violation
// 46 - Java DDL
// 51 - Invalid Application State
// 53 - Invalid Operand or Inconsistent Specification
// 54 - SQL or Product Limit Exceeded
// 55 - Object Not in Prerequisite State
// 56 - Miscellaneous SQL or Product Error
// 57 - Resource Not Available or Operator Intervention
// 58 - System Error
enum ResultCode {
// Class
// 00 - Successful Completion
OK = 0;
WARNING = 100; // Warning
// General Errors
INTERNAL_ERROR = 201; // SQLState: XX000 - Error caused by internal bugs (See TajoInternalException)
NOT_IMPLEMENTED = 202; // SQLState: 0A000 - Not implemented yet, but planned.
FEATURE_NOT_SUPPORTED = 203; // SQLState: 0A000 - Unsupported feature (usually for unreasonable feature)
INVALID_RPC_CALL = 204; // SQLState: 08P01 - When invalid RPC call is invoked (e.g., wrong message and absent fields)
// Query Management and Scheduler
QUERY_FAILED = 301; // SQLState: 61T01 - Query failed
QUERY_KILLED = 302; // SQLState: 61T02 - Query killed
QUERY_TIMEOUT = 303; // SQLState: 61T03 - Timeout for the query
QUERY_NOT_FOUND = 304; // SQLState: 61T04 - No such query in TajoMaster
NO_DATA = 305; // SQLState: 61T05 - No data due to query fail or error
INCOMPLETE_QUERY = 306; // SQLState: 61T06 - It occurs when a client requests something of a completed query.
// Session
INVALID_SESSION = 401; // SQLState: 62T01 - Session already was invalid
NO_SUCH_SESSION_VARIABLE = 402; // SQLState: 62T01 - Session variable not found
INVALID_SESSION_VARIABLE = 403; // SQLState: 62T01 - Session variable is invalid (type mismatch or out of range)
// Data Exception (SQLState Class - 22)
DIVISION_BY_ZERO = 451; // SQLState: 22012 - Division by zero
INVALID_VALUE_FOR_CAST = 452; // SQLState: 22T01 - Invalid data value for cast
INVALID_URL = 453; // SQLState: 22T02 - Invalid URL
// Section: Class 42 - Syntax Error or Access Rule Violation
SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION = 501; // SQLState: 42000
SYNTAX_ERROR = 502; // SQLState: 42601
INSUFFICIENT_PRIVILEGE = 503; // SQLState: 42501
CANNOT_DROP_CURRENT_DATABASE = 504; // SQLState: 42T01
UNDEFINED_TABLESPACE = 511; // ?
UNDEFINED_DATABASE = 512; // SQLState: 42T02
UNDEFINED_SCHEMA = 513; // SQLState:
UNDEFINED_TABLE = 514; // SQLState: 42P01
UNDEFINED_COLUMN = 515; // SQLState: 42703
UNDEFINED_FUNCTION = 516; // SQLState: 42883
UNDEFINED_INDEX_FOR_TABLE = 517; // ?
UNDEFINED_INDEX_FOR_COLUMNS = 518; // ?
UNDEFINED_INDEX_NAME = 519; // ?
UNDEFINED_PARTITION = 520; // ?
UNDEFINED_PARTITION_METHOD = 521; // ?
UNDEFINED_OPERATOR = 522; // SQLState: 42883 (=UNDEFINED_FUNCTION)
UNDEFINED_PARTITION_KEY = 523; // ?
UNDEFINED_TABLESPACE_HANDLER = 524; // SQLState: 42T11 - No Tablespace Handler for the URI scheme
UNDEFINED_PARTITIONS = 525; // ?
DUPLICATE_TABLESPACE = 531;
DUPLICATE_DATABASE = 532; // SQLState: 42P04
DUPLICATE_SCHEMA = 533; // SQLState: 42P06
DUPLICATE_TABLE = 534; // SQLState: 42P07
DUPLICATE_COLUMN = 535; // SQLState: 42701
DUPLICATE_ALIAS = 536; // SQLState: 42712
DUPLICATE_FUNCTION = 537; // SQLState: 42723
DUPLICATE_INDEX = 538; // SQLState: 42T07
DUPLICATE_PARTITION = 539; // SQLState: 42T08
AMBIGUOUS_TABLE = 541; // SQLState: 42P09
AMBIGUOUS_COLUMN = 542; // SQLState: 42702;
AMBIGUOUS_FUNCTION = 543; // SQLState: 42725;
AMBIGUOUS_PARTITION_DIRECTORY = 544; // ?
CANNOT_CAST = 601; // SQLState: 42846 - Cast from source type to target type is not supported.
GROUPING_ERROR = 602; // SQLState: 42803
WINDOWING_ERROR = 603; // SQLState: 42P20 - PgSQL implementation-defined
INVALID_RECURSION = 604; // SQLState: 42P19 - PgSQL implementation-defined
SET_OPERATION_SCHEMA_MISMATCH = 605; // SQLState: 42601 (=SYNTAX_ERROR)
SET_OPERATION_DATATYPE_MISMATCH = 606; // SQLState: 42601 (=SYNTAX_ERROR)
INVALID_FOREIGN_KEY = 621; // SQLState: 42830
INVALID_NAME = 622; // SQLState: 42602
INVALID_COLUMN_DEFINITION = 623; // SQLState: 42611
NAME_TOO_LONG = 624; // SQLState: 42622
RESERVED_NAME = 625; // SQLState: 42939
DATATYPE_MISMATCH = 626; // SQLState: 42804
INDETERMINATE_DATATYPE = 627; // SQLState: 42P18 - PgSQL implementation -defined
// Expressions
INVALID_EXPRESSION = 701;
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
// Catalog store
CAT_UNSUPPORTED_CATALOG_STORE = 905; // Unsupported type of catalog store
// Linked Metadata (LMD)
LMD_NO_MATCHED_DATATYPE = 910; // No matched data type between Tajo and connector
// Storage and Data Format
UNAVAILABLE_TABLE_LOCATION = 1001; // SQLState: ? - Unavailable table location
UNKNOWN_DATAFORMAT = 1002; // SQLState: ? - Unknown Data Format
UNSUPPORTED_DATATYPE = 1003; // SQLState: ? - Unsupported data type
INVALID_TABLE_PROPERTY = 1004; // SQLState: ? - Invalid Table Property
MISSING_TABLE_PROPERTY = 1005; // SQLState: ? - Missing table property
INVALID_TABLESPACE_URI = 1006;
// Client Connection
CLIENT_CONNECTION_EXCEPTION = 1101; // SQLState: 08000 - Client connection error
CLIENT_CONNECTION_DOES_NOT_EXIST = 1103; // SQLState: 08003 - Client connection has been closed.
CLIENT_UNABLE_TO_ESTABLISH_CONNECTION = 1102; // SQLState: 08006 - Client connection failure
CLIENT_PROTOCOL_PROTOCOL_VIOLATION = 1104; // SQLState: 08P01 - Protocol violation
// 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_LARGE_INPUT_FOR_CROSS_JOIN = 54003;
INVALID_INPUTS_FOR_CROSS_JOIN = 54004;
TOO_MANY_TABLES = 54006;
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;
// underlying system errors based on errno.h.
SYS_EPERM = 10001; // Operation not permitted
SYS_ENOENT = 10002; // No such file or directory
SYS_ESRCH = 10003; // No such process
SYS_EINTR = 10004; // Interrupted system call
SYS_EIO = 10005; // I/O error
SYS_ENXIO = 10006; // No such device or address
SYS_E2BIG = 10007; // Argument list too long
SYS_ENOEXEC = 10008; // Exec format error
SYS_EBADF = 10009; // Bad file number
SYS_ECHILD = 10010; // No child processes
SYS_EAGAIN = 10011; // Try again
SYS_ENOMEM = 10012; // Out of memory
SYS_EACCES = 10013; // Permission denied
SYS_EFAULT = 10014; // Bad address
SYS_ENOTBLK = 10015; // Block device required
SYS_EBUSY = 10016; // Device or resource busy
SYS_EEXIST = 10017; // File exists
SYS_EXDEV = 10018; // Cross-device link
SYS_ENODEV = 10019; // No such device
SYS_ENOTDIR = 10020; // Not a directory
SYS_EISDIR = 10021; // Is a directory
SYS_EINVAL = 10022; // Invalid argument
SYS_ENFILE = 10023; // File table overflow
SYS_EMFILE = 10024; // Too many open files
SYS_ENOTTY = 10025; // Not a typewriter
SYS_ETXTBSY = 10026; // Text file busy
SYS_EFBIG = 10027; // File too large
SYS_ENOSPC = 10028; // No space left on device
SYS_ESPIPE = 10029; // Illegal seek
SYS_EROFS = 10030; // Read-only file system
SYS_EMLINK = 10031; // Too many links
SYS_EPIPE = 10032; // Broken pipe
SYS_EDOM = 10033; // Math argument out of domain of func
SYS_ERANGE = 10034; // Math result not representable
SYS_EDEADLK = 10035; // Resource deadlock would occur
SYS_ENAMETOOLONG = 10036; // File name too long
SYS_ENOLCK = 10037; // No record locks available
SYS_ENOSYS = 10038; // Function not implemented
SYS_ENOTEMPTY = 10039; // Directory not empty
SYS_ELOOP = 10040; // Too many symbolic links encountered
// EWOULDBLOCK = EAGAIN // Operation would block
SYS_ENOMSG = 10042; // No message of desired type
SYS_EIDRM = 10043; // Identifier removed
SYS_ECHRNG = 10044; // Channel number out of range
SYS_EL2NSYNC = 10045; // Level 2 not synchronized
SYS_EL3HLT = 10046; // Level 3 halted
SYS_EL3RST = 10047; // Level 3 reset
SYS_ELNRNG = 10048; // Link number out of range
SYS_EUNATCH = 10049; // Protocol driver not attached
SYS_ENOCSI = 10050; // No CSI structure available
SYS_EL2HLT = 10051; // Level 2 halted
SYS_EBADE = 10052; // Invalid exchange
SYS_EBADR = 10053; // Invalid request descriptor
SYS_EXFULL = 10054; // Exchange full
SYS_ENOANO = 10055; // No anode
SYS_EBADRQC = 10056; // Invalid request code
SYS_EBADSLT = 10057; // Invalid slot
// EDEADLOCK = EDEADLK
SYS_EBFONT = 10059; // Bad font file format
SYS_ENOSTR = 10060; // Device not a stream
SYS_ENODATA = 10061; // No data available
SYS_ETIME = 10062; // Timer expired
SYS_ENOSR = 10063; // Out of streams resources
SYS_ENONET = 10064; // Machine is not on the network
SYS_ENOPKG = 10065; // Package not installed
SYS_EREMOTE = 10066; // Object is remote
SYS_ENOLINK = 10067; // Link has been severed
SYS_EADV = 10068; // Advertise error
SYS_ESRMNT = 10069; // Srmount error
SYS_ECOMM = 10070; // Communication error on send
SYS_EPROTO = 10071; // Protocol error
SYS_EMULTIHOP = 10072; // Multihop attempted
SYS_EDOTDOT = 10073; // RFS specific error
SYS_EBADMSG = 10074; // Not a data message
SYS_EOVERFLOW = 10075; // Value too large for defined data type
SYS_ENOTUNIQ = 10076; // Name not unique on network
SYS_EBADFD = 10077; // File descriptor in bad state
SYS_EREMCHG = 10078; // Remote address changed
SYS_ELIBACC = 10079; // Can not access a needed shared library
SYS_ELIBBAD = 10080; // Accessing a corrupted shared library
SYS_ELIBSCN = 10081; // .lib section in a.out corrupted
SYS_ELIBMAX = 10082; // Attempting to link in too many shared libraries
SYS_ELIBEXEC = 10083; // Cannot exec a shared library directly
SYS_EILSEQ = 10084; // Illegal byte sequence
SYS_ERESTART = 10085; // Interrupted system call should be restarted
SYS_ESTRPIPE = 10086; // Streams pipe error
SYS_EUSERS = 10087; // Too many users
SYS_ENOTSOCK = 10088; // Socket operation on non-socket
SYS_EDESTADDRREQ = 10089; // Destination address required
SYS_EMSGSIZE = 10090; // Message too long
SYS_EPROTOTYPE = 10091; // Protocol wrong type for socket
SYS_ENOPROTOOPT = 10092; // Protocol not available
SYS_EPROTONOSUPPORT = 10093; // Protocol not supported
SYS_ESOCKTNOSUPPORT = 10094; // Socket type not supported
SYS_EOPNOTSUPP = 10095; // Operation not supported on transport endpoint
SYS_EPFNOSUPPORT = 10096; // Protocol family not supported
SYS_EAFNOSUPPORT = 10097; // Address family not supported by protocol
SYS_EADDRINUSE = 10098; // Address already in use
SYS_EADDRNOTAVAIL = 10099; // Cannot assign requested address
SYS_ENETDOWN = 10100; // Network is down
SYS_ENETUNREACH = 10101; // Network is unreachable
SYS_ENETRESET = 10102; // Network dropped connection because of reset
SYS_ECONNABORTED = 10103; // Software caused connection abort
SYS_ECONNRESET = 10104; // Connection reset by peer
SYS_ENOBUFS = 10105; // No buffer space available
SYS_EISCONN = 10106; // Transport endpoint is already connected
SYS_ENOTCONN = 10107; // Transport endpoint is not connected
SYS_ESHUTDOWN = 10108; // Cannot send after transport endpoint shutdown
SYS_ETOOMANYREFS = 10109; // Too many references: cannot splice
SYS_ETIMEDOUT = 10110; // Connection timed out
SYS_ECONNREFUSED = 10111; // Connection refused
SYS_EHOSTDOWN = 10112; // Host is down
SYS_EHOSTUNREACH = 10113; // No route to host
SYS_EALREADY = 10114; // Operation already in progress
SYS_EINPROGRESS = 10115; // Operation now in progress
SYS_ESTALE = 10116; // Stale NFS file handle
SYS_EUCLEAN = 10117; // Structure needs cleaning
SYS_ENOTNAM = 10118; // Not a XENIX named type file
SYS_ENAVAIL = 10119; // No XENIX semaphores available
SYS_EISNAM = 10120; // Is a named type file
SYS_EREMOTEIO = 10121; // Remote I/O error
SYS_EDQUOT = 10122; // Quota exceeded
SYS_ENOMEDIUM = 10123; // No medium found
SYS_EMEDIUMTYPE = 10124; // Wrong medium type
SYS_ECANCELED = 10125; // Operation Canceled
SYS_ENOKEY = 10126; // Required key not available
SYS_EKEYEXPIRED = 10127; // Key has expired
SYS_EKEYREVOKED = 10128; // Key has been revoked
SYS_EKEYREJECTED = 10129; // Key was rejected by service
// for robust mutexes
SYS_EOWNERDEAD = 10130; // Owner died
SYS_ENOTRECOVERABLE = 10131; // State not recoverable
}
message SerializedException {
required int64 timestamp = 1; // Microseconds since Epoch.
required ResultCode return_code = 2;
required string message = 3;
optional StackTrace stack_trace = 4;
}