constant.py 2.6 KB
Newer Older
C
cpwu 已提交
1 2
# -*- coding: utf-8 -*-

C
cpwu 已提交
3 4 5 6 7 8 9 10 11
# basic type
TAOS_DATA_TYPE  = [
    "INT", "BIGINT", "SMALLINT", "TINYINT", "INT UNSIGNED", "BIGINT UNSIGNED", "SMALLINT UNSIGNED", "TINYINT UNSIGNED",
    "FLOAT", "DOUBLE",
    "BOOL",
    "BINARY", "NCHAR", "VARCHAR",
    "TIMESTAMP",
    # "MEDIUMBLOB", "BLOB", # add in 3.x
    # "DECIMAL", "NUMERIC", # add in 3.x
C
cpwu 已提交
12
    "JSON", # only for tag
C
cpwu 已提交
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
]

TAOS_NUM_TYPE   = [
    "INT", "BIGINT", "SMALLINT", "TINYINT", "INT UNSIGNED", "BIGINT UNSIGNED", "SMALLINT UNSIGNED", "TINYINT UNSIGNED", "FLOAT", "DOUBLE",
    # "DECIMAL", "NUMERIC", # add in 3.x
]
TAOS_CHAR_TYPE  = [
    "BINARY", "NCHAR", "VARCHAR",
]
TAOS_BOOL_TYPE  = ["BOOL",]
TAOS_TS_TYPE    = ["TIMESTAMP",]
TAOS_BIN_TYPE   = [
    "MEDIUMBLOB", "BLOB", # add in 3.x
]

C
cpwu 已提交
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
# basic data type boundary
TINYINT_MAX             = 127
TINYINT_MIN             = -128

TINYINT_UN_MAX          = 255
TINYINT_UN_MIN          = 0

SMALLINT_MAX            = 32767
SMALLINT_MIN            = -32768

SMALLINT_UN_MAX         = 65535
MALLINT_UN_MIN          = 0

INT_MAX                 = 2147483647
INT_MIN                 = -2147483648

INT_UN_MAX              = 4294967295
INT_UN_MIN              = 0

BIGINT_MAX              = 9223372036854775807
BIGINT_MIN              = -9223372036854775808

BIGINT_UN_MAX           = 18446744073709551615
BIGINT_UN_MIN           = 0

FLOAT_MAX               = 3.40E+38
FLOAT_MIN               = -3.40E+38

DOUBLE_MAX              = 1.7E+308
DOUBLE_MIN              = -1.7E+308

# schema boundary
BINARY_LENGTH_MAX       = 16374
NCAHR_LENGTH_MAX_       = 4093
DBNAME_LENGTH_MAX_      = 64

STBNAME_LENGTH_MAX      = 192
STBNAME_LENGTH_MIN      = 1

TBNAME_LENGTH_MAX       = 192
TBNAME_LENGTH_MIN       = 1

CHILD_TBNAME_LENGTH_MAX = 192
CHILD_TBNAME_LENGTH_MIN = 1

TAG_NAME_LENGTH_MAX     = 64
TAG_NAME_LENGTH_MIN     = 1

COL_NAME_LENGTH_MAX     = 64
COL_NAME_LENGTH_MIN     = 1

TAG_COUNT_MAX           = 128
TAG_COUNT_MIN           = 1

COL_COUNT_MAX           = 4096
COL_COUNT_MIN           = 2

TAG_COL_COUNT_MAX       = 4096
TAG_COL_COUNT_MIN       = 3

MNODE_SHM_SIZE_MAX      = 2147483647
MNODE_SHM_SIZE_MIN      = 6292480
MNODE_SHM_SIZE_DEFAULT  = 6292480

VNODE_SHM_SIZE_MAX      = 2147483647
VNODE_SHM_SIZE_MIN      = 6292480
C
cpwu 已提交
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
VNODE_SHM_SIZE_DEFAULT  = 31458304

# time_init
TIME_MS = 1
TIME_US = TIME_MS/1000
TIME_NS = TIME_US/1000

TIME_S = 1000 * TIME_MS
TIME_M = 60 * TIME_S
TIME_H = 60 * TIME_M
TIME_D = 24 * TIME_H
TIME_W = 7 * TIME_D
TIME_N = 30 * TIME_D
TIME_Y = 365 * TIME_D



# streams and related agg-function
SMA_INDEX_FUNCTIONS = ["MIN", "MAX"]
ROLLUP_FUNCTIONS = ["AVG", "SUM", "MIN", "MAX", "LAST", "FIRST"]
SMA_WATMARK_MAXDELAY_INIT = ['a', "s", "m"]