function_histogram.py 73.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 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
###################################################################
#           Copyright (c) 2021 by TAOS Technologies, Inc.
#                     All rights reserved.
#
#  This file is proprietary and confidential to TAOS Technologies.
#  No part of this file may be reproduced, stored, transmitted,
#  disclosed or used in any form or by any means other than as
#  expressly provided by the written permission from Jianhui Tao
#
###################################################################

# -*- coding: utf-8 -*-

import sys
from util.log import *
from util.cases import *
from util.sql import *


class TDTestCase:
    def caseDescription(self):
        '''
        case1<Ganlin Zhao>: [TD-11222]<feature>: Histogram function
        '''
        return

    def init(self, conn, logSql):
        tdLog.debug("start to execute %s" % __file__)
        tdSql.init(conn.cursor(), logSql)

    def getBuildPath(self):
        selfPath = os.path.dirname(os.path.realpath(__file__))

        if ("community" in selfPath):
            projPath = selfPath[:selfPath.find("community")]
        else:
            projPath = selfPath[:selfPath.find("tests")]

        for root, dirs, files in os.walk(projPath):
            if ("taosd" in files):
                rootRealPath = os.path.dirname(os.path.realpath(root))
                if ("packaging" not in rootRealPath):
                    buildPath = root[:len(root) - len("/build/bin")]
                    break
        return buildPath

    def run(self):
        print("running {}".format(__file__))
        tdSql.execute("drop database if exists db")
        tdSql.execute("create database if not exists db")
        tdSql.execute('use db')

        #Prepare data
        tdSql.execute("create stable stb (col_timestamp timestamp, col_tinyint tinyint, col_smallint smallint, col_int int, col_bigint bigint, col_float float, col_double double, col_bool bool, col_binary binary(10), col_nchar nchar(10)) \
                       tags(tag_timestamp timestamp, tag_tinyint tinyint, tag_smallint smallint, tag_int int, tag_bigint bigint, tag_float float, tag_double double, tag_bool bool, tag_binary binary(10), tag_nchar nchar(10));")
        tdSql.execute("create table ctb using stb tags (now, 1, 1, 1, 1, 1.0, 1.0, true, 'abc', 'abc');")
        tdSql.execute("create table tb (col_timestamp timestamp, col_tinyint tinyint, col_smallint smallint, col_int int, col_bigint bigint, col_float float, col_double double, col_bool bool, col_binary binary(10), col_nchar nchar(10));")

        tdSql.execute("insert into ctb values (now, -9, -9, -9, -9, -9.5, -9.5, true, 'abc', 'abc');")
60 61 62 63 64 65 66 67 68 69 70 71 72 73
        tdSql.execute("insert into ctb values (now + 1s, -1, -1, -1, -1, -1.5, -1.5, true, 'abc', 'abc');")
        tdSql.execute("insert into ctb values (now + 2s, 1, 1, 1, 1, 1.5, 1.5, true, 'abc', 'abc');")
        tdSql.execute("insert into ctb values (now + 3s, 2, 2, 2, 2, 2.5, 2.5, true, 'abc', 'abc');")
        tdSql.execute("insert into ctb values (now + 4s, 3, 3, 3, 3, 3.5, 3.5, true, 'abc', 'abc');")
        tdSql.execute("insert into ctb values (now + 5s, 4, 4, 4, 4, 4.5, 4.5, true, 'abc', 'abc');")
        tdSql.execute("insert into ctb values (now + 6s, 5, 5, 5, 5, 5.5, 5.5, true, 'abc', 'abc');")
        tdSql.execute("insert into ctb values (now + 7s, 6, 6, 6, 6, 6.5, 6.5, true, 'abc', 'abc');")
        tdSql.execute("insert into ctb values (now + 8s, 7, 7, 7, 7, 7.5, 7.5, false, 'abc', 'abc');")
        tdSql.execute("insert into ctb values (now + 9s, 8, 8, 8, 8, 8.5, 8.5, false, 'abc', 'abc');")
        tdSql.execute("insert into ctb values (now + 10s, 9, 9, 9, 9, 9.5, 9.5, false, 'abc', 'abc');")
        tdSql.execute("insert into ctb values (now + 11s, 10, 10, 10, 10, 10.5, 10.5, false, 'abc', 'abc');")
        tdSql.execute("insert into ctb values (now + 12s, 15, 15, 15, 15, 15.5, 15.5, false, 'abc', 'abc');")
        tdSql.execute("insert into ctb values (now + 13s, 20, 20, 20, 20, 20.5, 20.5, false, 'abc', 'abc');")
        tdSql.execute("insert into ctb values (now + 14s, 99, 99, 99, 99, 99.5, 99.5, false, 'abc', 'abc');")
74 75

        tdSql.execute("insert into tb values (now, -9, -9, -9, -9, -9.5, -9.5, true, 'abc', 'abc');")
76 77 78 79 80 81 82 83 84 85 86 87 88 89
        tdSql.execute("insert into tb values (now + 1s, -1, -1, -1, -1, -1.5, -1.5, true, 'abc', 'abc');")
        tdSql.execute("insert into tb values (now + 2s, 1, 1, 1, 1, 1.5, 1.5, true, 'abc', 'abc');")
        tdSql.execute("insert into tb values (now + 3s, 2, 2, 2, 2, 2.5, 2.5, true, 'abc', 'abc');")
        tdSql.execute("insert into tb values (now + 4s, 3, 3, 3, 3, 3.5, 3.5, true, 'abc', 'abc');")
        tdSql.execute("insert into tb values (now + 5s, 4, 4, 4, 4, 4.5, 4.5, true, 'abc', 'abc');")
        tdSql.execute("insert into tb values (now + 6s, 5, 5, 5, 5, 5.5, 5.5, true, 'abc', 'abc');")
        tdSql.execute("insert into tb values (now + 7s, 6, 6, 6, 6, 6.5, 6.5, true, 'abc', 'abc');")
        tdSql.execute("insert into tb values (now + 8s, 7, 7, 7, 7, 7.5, 7.5, false, 'abc', 'abc');")
        tdSql.execute("insert into tb values (now + 9s, 8, 8, 8, 8, 8.5, 8.5, false, 'abc', 'abc');")
        tdSql.execute("insert into tb values (now + 10s, 9, 9, 9, 9, 9.5, 9.5, false, 'abc', 'abc');")
        tdSql.execute("insert into tb values (now + 11s, 10, 10, 10, 10, 10.5, 10.5, false, 'abc', 'abc');")
        tdSql.execute("insert into tb values (now + 12s, 15, 15, 15, 15, 15.5, 15.5, false, 'abc', 'abc');")
        tdSql.execute("insert into tb values (now + 13s, 20, 20, 20, 20, 20.5, 20.5, false, 'abc', 'abc');")
        tdSql.execute("insert into tb values (now + 14s, 99, 99, 99, 99, 99.5, 99.5, false, 'abc', 'abc');")
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152

        #execute query
        print("============== STEP 1: column types  ================== ")
        #Supported column types
        tdSql.query('select histogram(col_tinyint, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.checkRows(3);
        tdSql.query('select histogram(col_tinyint, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.checkRows(3);
        tdSql.query('select histogram(col_tinyint, "user_input", "[1,3,5,7]", 0) from tb;')
        tdSql.checkRows(3);

        tdSql.query('select histogram(col_smallint, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.checkRows(3);
        tdSql.query('select histogram(col_smallint, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.checkRows(3);
        tdSql.query('select histogram(col_smallint, "user_input", "[1,3,5,7]", 0) from tb;')
        tdSql.checkRows(3);

        tdSql.query('select histogram(col_int, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.checkRows(3);
        tdSql.query('select histogram(col_int, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.checkRows(3);
        tdSql.query('select histogram(col_int, "user_input", "[1,3,5,7]", 0) from tb;')
        tdSql.checkRows(3);

        tdSql.query('select histogram(col_bigint, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.checkRows(3);
        tdSql.query('select histogram(col_bigint, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.checkRows(3);
        tdSql.query('select histogram(col_bigint, "user_input", "[1,3,5,7]", 0) from tb;')
        tdSql.checkRows(3);

        tdSql.query('select histogram(col_float, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.checkRows(3);
        tdSql.query('select histogram(col_float, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.checkRows(3);
        tdSql.query('select histogram(col_float, "user_input", "[1,3,5,7]", 0) from tb;')
        tdSql.checkRows(3);

        tdSql.query('select histogram(col_double, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.checkRows(3);
        tdSql.query('select histogram(col_double, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.checkRows(3);
        tdSql.query('select histogram(col_double, "user_input", "[1,3,5,7]", 0) from tb;')
        tdSql.checkRows(3);

        #Unsupported column types
        tdSql.error('select histogram(col_timestamp, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(col_timestamp, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(col_timestamp, "user_input", "[1,3,5,7]", 0) from tb;')

        tdSql.error('select histogram(col_bool, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(col_bool, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(col_bool, "user_input", "[1,3,5,7]", 0) from tb;')

        tdSql.error('select histogram(col_binary, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(col_binary, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(col_binary, "user_input", "[1,3,5,7]", 0) from tb;')

        tdSql.error('select histogram(col_nchar, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(col_nchar, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(col_nchar, "user_input", "[1,3,5,7]", 0) from tb;')

153 154 155 156
        tdSql.error('select histogram(col, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(col, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(col, "user_input", "[1,3,5,7]", 0) from tb;')

157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
        #Unsupported tags
        tdSql.error('select histogram(tag_timestamp, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(tag_timestamp, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(tag_timestamp, "user_input", "[1,3,5,7]", 0) from tb;')

        tdSql.error('select histogram(tag_tinyint, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(tag_tinyint, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(tag_tinyint, "user_input", "[1,3,5,7]", 0) from tb;')

        tdSql.error('select histogram(tag_smallint, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(tag_smallint, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(tag_smallint, "user_input", "[1,3,5,7]", 0) from tb;')

        tdSql.error('select histogram(tag_int, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(tag_int, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(tag_int, "user_input", "[1,3,5,7]", 0) from tb;')

        tdSql.error('select histogram(tag_bigint, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(tag_bigint, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(tag_bigint, "user_input", "[1,3,5,7]", 0) from tb;')

        tdSql.error('select histogram(tag_float, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(tag_float, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(tag_float, "user_input", "[1,3,5,7]", 0) from tb;')

        tdSql.error('select histogram(tag_double, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(tag_double, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(tag_double, "user_input", "[1,3,5,7]", 0) from tb;')

        tdSql.error('select histogram(tag_bool, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(tag_bool, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(tag_bool, "user_input", "[1,3,5,7]", 0) from tb;')

        tdSql.error('select histogram(tag_binary, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(tag_binary, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(tag_binary, "user_input", "[1,3,5,7]", 0) from tb;')

        tdSql.error('select histogram(tag_nchar, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.error('select histogram(tag_nchar, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.error('select histogram(tag_nchar, "user_input", "[1,3,5,7]", 0) from tb;')


        print("============== STEP 2: bin types  ================== ")
200
        ## user_input ##
201 202 203
        #TINYINT
        tdSql.query('select histogram(col_tinyint, "user_input", "[1,3,5]", 0) from stb;')
        tdSql.checkRows(2);
204 205
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
206 207
        tdSql.query('select histogram(col_tinyint, "user_input", "[1,3,5]", 0) from ctb;')
        tdSql.checkRows(2);
208 209
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
210 211
        tdSql.query('select histogram(col_tinyint, "user_input", "[1,3,5]", 0) from tb;')
        tdSql.checkRows(2);
212 213
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
214 215 216

        tdSql.query('select histogram(col_tinyint, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.checkRows(3);
217 218 219
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
220 221
        tdSql.query('select histogram(col_tinyint, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.checkRows(3);
222 223 224
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
225 226
        tdSql.query('select histogram(col_tinyint, "user_input", "[1,3,5,7]", 0) from tb;')
        tdSql.checkRows(3);
227 228 229
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
230 231 232

        tdSql.query('select histogram(col_tinyint, "user_input", "[0,10,20,100]", 0) from stb;')
        tdSql.checkRows(3);
233 234 235
        tdSql.checkData(0, 0, "(0:10]:10");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
236 237
        tdSql.query('select histogram(col_tinyint, "user_input", "[0,10,20,100]", 0) from ctb;')
        tdSql.checkRows(3);
238 239 240
        tdSql.checkData(0, 0, "(0:10]:10");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
241 242
        tdSql.query('select histogram(col_tinyint, "user_input", "[0,10,20,100]", 0) from tb;')
        tdSql.checkRows(3);
243 244 245
        tdSql.checkData(0, 0, "(0:10]:10");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
246 247 248

        tdSql.query('select histogram(col_tinyint, "user_input", "[-10,10,20,100]", 0) from stb;')
        tdSql.checkRows(3);
249 250 251
        tdSql.checkData(0, 0, "(-10:10]:12");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
252 253
        tdSql.query('select histogram(col_tinyint, "user_input", "[-10,10,20,100]", 0) from ctb;')
        tdSql.checkRows(3);
254 255 256
        tdSql.checkData(0, 0, "(-10:10]:12");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
257 258
        tdSql.query('select histogram(col_tinyint, "user_input", "[-10,10,20,100]", 0) from tb;')
        tdSql.checkRows(3);
259 260 261
        tdSql.checkData(0, 0, "(-10:10]:12");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
262 263 264

        tdSql.query('select histogram(col_tinyint, "user_input", "[-8.9,9.9,19.9,99.9]", 0) from stb;')
        tdSql.checkRows(3);
265 266 267
        tdSql.checkData(0, 0, "(-8.9:9.9]:10");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:99.9]:2");
268 269
        tdSql.query('select histogram(col_tinyint, "user_input", "[-8.9,9.9,19.9,99.9]", 0) from ctb;')
        tdSql.checkRows(3);
270 271 272
        tdSql.checkData(0, 0, "(-8.9:9.9]:10");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:99.9]:2");
273 274
        tdSql.query('select histogram(col_tinyint, "user_input", "[-8.9,9.9,19.9,99.9]", 0) from tb;')
        tdSql.checkRows(3);
275 276 277
        tdSql.checkData(0, 0, "(-8.9:9.9]:10");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:99.9]:2");
278 279 280

        tdSql.query('select histogram(col_tinyint, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from stb;')
        tdSql.checkRows(3);
281 282 283
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
284 285
        tdSql.query('select histogram(col_tinyint, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from ctb;')
        tdSql.checkRows(3);
286 287 288
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
289 290
        tdSql.query('select histogram(col_tinyint, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from tb;')
        tdSql.checkRows(3);
291 292 293
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
294 295 296 297

        #SMALLINT
        tdSql.query('select histogram(col_smallint, "user_input", "[1,3,5]", 0) from stb;')
        tdSql.checkRows(2);
298 299
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
300 301
        tdSql.query('select histogram(col_smallint, "user_input", "[1,3,5]", 0) from ctb;')
        tdSql.checkRows(2);
302 303
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
304 305
        tdSql.query('select histogram(col_smallint, "user_input", "[1,3,5]", 0) from tb;')
        tdSql.checkRows(2);
306 307
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
308 309 310

        tdSql.query('select histogram(col_smallint, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.checkRows(3);
311 312 313
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
314 315
        tdSql.query('select histogram(col_smallint, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.checkRows(3);
316 317 318
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
319 320
        tdSql.query('select histogram(col_smallint, "user_input", "[1,3,5,7]", 0) from tb;')
        tdSql.checkRows(3);
321 322 323
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
324 325 326

        tdSql.query('select histogram(col_smallint, "user_input", "[0,10,20,100]", 0) from stb;')
        tdSql.checkRows(3);
327 328 329
        tdSql.checkData(0, 0, "(0:10]:10");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
330 331
        tdSql.query('select histogram(col_smallint, "user_input", "[0,10,20,100]", 0) from ctb;')
        tdSql.checkRows(3);
332 333 334
        tdSql.checkData(0, 0, "(0:10]:10");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
335 336
        tdSql.query('select histogram(col_smallint, "user_input", "[0,10,20,100]", 0) from tb;')
        tdSql.checkRows(3);
337 338 339
        tdSql.checkData(0, 0, "(0:10]:10");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
340 341 342

        tdSql.query('select histogram(col_smallint, "user_input", "[-10,10,20,100]", 0) from stb;')
        tdSql.checkRows(3);
343 344 345
        tdSql.checkData(0, 0, "(-10:10]:12");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
346 347
        tdSql.query('select histogram(col_smallint, "user_input", "[-10,10,20,100]", 0) from ctb;')
        tdSql.checkRows(3);
348 349 350
        tdSql.checkData(0, 0, "(-10:10]:12");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
351 352
        tdSql.query('select histogram(col_smallint, "user_input", "[-10,10,20,100]", 0) from tb;')
        tdSql.checkRows(3);
353 354 355
        tdSql.checkData(0, 0, "(-10:10]:12");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
356 357 358

        tdSql.query('select histogram(col_smallint, "user_input", "[-8.9,9.9,19.9,99.9]", 0) from stb;')
        tdSql.checkRows(3);
359 360 361
        tdSql.checkData(0, 0, "(-8.9:9.9]:10");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:99.9]:2");
362 363
        tdSql.query('select histogram(col_smallint, "user_input", "[-8.9,9.9,19.9,99.9]", 0) from ctb;')
        tdSql.checkRows(3);
364 365 366
        tdSql.checkData(0, 0, "(-8.9:9.9]:10");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:99.9]:2");
367 368
        tdSql.query('select histogram(col_smallint, "user_input", "[-8.9,9.9,19.9,99.9]", 0) from tb;')
        tdSql.checkRows(3);
369 370 371
        tdSql.checkData(0, 0, "(-8.9:9.9]:10");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:99.9]:2");
372 373 374

        tdSql.query('select histogram(col_smallint, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from stb;')
        tdSql.checkRows(3);
375 376 377
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
378 379
        tdSql.query('select histogram(col_smallint, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from ctb;')
        tdSql.checkRows(3);
380 381 382
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
383 384
        tdSql.query('select histogram(col_smallint, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from tb;')
        tdSql.checkRows(3);
385 386 387
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
388 389 390 391

        #INT
        tdSql.query('select histogram(col_int, "user_input", "[1,3,5]", 0) from stb;')
        tdSql.checkRows(2);
392 393
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
394 395
        tdSql.query('select histogram(col_int, "user_input", "[1,3,5]", 0) from ctb;')
        tdSql.checkRows(2);
396 397
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
398 399
        tdSql.query('select histogram(col_int, "user_input", "[1,3,5]", 0) from tb;')
        tdSql.checkRows(2);
400 401
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
402 403 404

        tdSql.query('select histogram(col_int, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.checkRows(3);
405 406 407
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
408 409
        tdSql.query('select histogram(col_int, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.checkRows(3);
410 411 412
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
413 414
        tdSql.query('select histogram(col_int, "user_input", "[1,3,5,7]", 0) from tb;')
        tdSql.checkRows(3);
415 416 417
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
418 419 420

        tdSql.query('select histogram(col_int, "user_input", "[0,10,20,100]", 0) from stb;')
        tdSql.checkRows(3);
421 422 423
        tdSql.checkData(0, 0, "(0:10]:10");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
424 425
        tdSql.query('select histogram(col_int, "user_input", "[0,10,20,100]", 0) from ctb;')
        tdSql.checkRows(3);
426 427 428
        tdSql.checkData(0, 0, "(0:10]:10");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
429 430
        tdSql.query('select histogram(col_int, "user_input", "[0,10,20,100]", 0) from tb;')
        tdSql.checkRows(3);
431 432 433
        tdSql.checkData(0, 0, "(0:10]:10");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
434 435 436

        tdSql.query('select histogram(col_int, "user_input", "[-10,10,20,100]", 0) from stb;')
        tdSql.checkRows(3);
437 438 439
        tdSql.checkData(0, 0, "(-10:10]:12");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
440 441
        tdSql.query('select histogram(col_int, "user_input", "[-10,10,20,100]", 0) from ctb;')
        tdSql.checkRows(3);
442 443 444
        tdSql.checkData(0, 0, "(-10:10]:12");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
445 446
        tdSql.query('select histogram(col_int, "user_input", "[-10,10,20,100]", 0) from tb;')
        tdSql.checkRows(3);
447 448 449
        tdSql.checkData(0, 0, "(-10:10]:12");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
450 451 452

        tdSql.query('select histogram(col_int, "user_input", "[-8.9,9.9,19.9,99.9]", 0) from stb;')
        tdSql.checkRows(3);
453 454 455
        tdSql.checkData(0, 0, "(-8.9:9.9]:10");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:99.9]:2");
456 457
        tdSql.query('select histogram(col_int, "user_input", "[-8.9,9.9,19.9,99.9]", 0) from ctb;')
        tdSql.checkRows(3);
458 459 460
        tdSql.checkData(0, 0, "(-8.9:9.9]:10");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:99.9]:2");
461 462
        tdSql.query('select histogram(col_int, "user_input", "[-8.9,9.9,19.9,99.9]", 0) from tb;')
        tdSql.checkRows(3);
463 464 465
        tdSql.checkData(0, 0, "(-8.9:9.9]:10");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:99.9]:2");
466 467 468

        tdSql.query('select histogram(col_int, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from stb;')
        tdSql.checkRows(3);
469 470 471
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
472 473
        tdSql.query('select histogram(col_int, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from ctb;')
        tdSql.checkRows(3);
474 475 476
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
477 478
        tdSql.query('select histogram(col_int, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from tb;')
        tdSql.checkRows(3);
479 480 481
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
482 483 484 485

        #BIGINT
        tdSql.query('select histogram(col_bigint, "user_input", "[1,3,5]", 0) from stb;')
        tdSql.checkRows(2);
486 487
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
488 489
        tdSql.query('select histogram(col_bigint, "user_input", "[1,3,5]", 0) from ctb;')
        tdSql.checkRows(2);
490 491
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
492 493
        tdSql.query('select histogram(col_bigint, "user_input", "[1,3,5]", 0) from tb;')
        tdSql.checkRows(2);
494 495
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
496 497 498

        tdSql.query('select histogram(col_bigint, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.checkRows(3);
499 500 501
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
502 503
        tdSql.query('select histogram(col_bigint, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.checkRows(3);
504 505 506
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
507 508
        tdSql.query('select histogram(col_bigint, "user_input", "[1,3,5,7]", 0) from tb;')
        tdSql.checkRows(3);
509 510 511
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
512 513 514

        tdSql.query('select histogram(col_bigint, "user_input", "[0,10,20,100]", 0) from stb;')
        tdSql.checkRows(3);
515 516 517
        tdSql.checkData(0, 0, "(0:10]:10");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
518 519
        tdSql.query('select histogram(col_bigint, "user_input", "[0,10,20,100]", 0) from ctb;')
        tdSql.checkRows(3);
520 521 522
        tdSql.checkData(0, 0, "(0:10]:10");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
523 524
        tdSql.query('select histogram(col_bigint, "user_input", "[0,10,20,100]", 0) from tb;')
        tdSql.checkRows(3);
525 526 527
        tdSql.checkData(0, 0, "(0:10]:10");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
528 529 530

        tdSql.query('select histogram(col_bigint, "user_input", "[-10,10,20,100]", 0) from stb;')
        tdSql.checkRows(3);
531 532 533
        tdSql.checkData(0, 0, "(-10:10]:12");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
534 535
        tdSql.query('select histogram(col_bigint, "user_input", "[-10,10,20,100]", 0) from ctb;')
        tdSql.checkRows(3);
536 537 538
        tdSql.checkData(0, 0, "(-10:10]:12");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
539 540
        tdSql.query('select histogram(col_bigint, "user_input", "[-10,10,20,100]", 0) from tb;')
        tdSql.checkRows(3);
541 542 543
        tdSql.checkData(0, 0, "(-10:10]:12");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:1");
544 545 546

        tdSql.query('select histogram(col_bigint, "user_input", "[-8.9,9.9,19.9,99.9]", 0) from stb;')
        tdSql.checkRows(3);
547 548 549
        tdSql.checkData(0, 0, "(-8.9:9.9]:10");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:99.9]:2");
550 551
        tdSql.query('select histogram(col_bigint, "user_input", "[-8.9,9.9,19.9,99.9]", 0) from ctb;')
        tdSql.checkRows(3);
552 553 554
        tdSql.checkData(0, 0, "(-8.9:9.9]:10");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:99.9]:2");
555 556
        tdSql.query('select histogram(col_bigint, "user_input", "[-8.9,9.9,19.9,99.9]", 0) from tb;')
        tdSql.checkRows(3);
557 558 559
        tdSql.checkData(0, 0, "(-8.9:9.9]:10");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:99.9]:2");
560 561 562

        tdSql.query('select histogram(col_bigint, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from stb;')
        tdSql.checkRows(3);
563 564 565
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
566 567
        tdSql.query('select histogram(col_bigint, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from ctb;')
        tdSql.checkRows(3);
568 569 570
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
571 572
        tdSql.query('select histogram(col_bigint, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from tb;')
        tdSql.checkRows(3);
573 574 575
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
576 577 578 579

        #FLOAT
        tdSql.query('select histogram(col_float, "user_input", "[1,3,5]", 0) from stb;')
        tdSql.checkRows(2);
580 581
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
582 583
        tdSql.query('select histogram(col_float, "user_input", "[1,3,5]", 0) from ctb;')
        tdSql.checkRows(2);
584 585
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
586 587
        tdSql.query('select histogram(col_float, "user_input", "[1,3,5]", 0) from tb;')
        tdSql.checkRows(2);
588 589
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
590 591 592

        tdSql.query('select histogram(col_float, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.checkRows(3);
593 594 595
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
596 597
        tdSql.query('select histogram(col_float, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.checkRows(3);
598 599 600
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
601 602
        tdSql.query('select histogram(col_float, "user_input", "[1,3,5,7]", 0) from tb;')
        tdSql.checkRows(3);
603 604 605
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
606 607 608

        tdSql.query('select histogram(col_float, "user_input", "[0,10,20,100]", 0) from stb;')
        tdSql.checkRows(3);
609 610 611
        tdSql.checkData(0, 0, "(0:10]:9");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:2");
612 613
        tdSql.query('select histogram(col_float, "user_input", "[0,10,20,100]", 0) from ctb;')
        tdSql.checkRows(3);
614 615 616
        tdSql.checkData(0, 0, "(0:10]:9");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:2");
617 618
        tdSql.query('select histogram(col_float, "user_input", "[0,10,20,100]", 0) from tb;')
        tdSql.checkRows(3);
619 620 621
        tdSql.checkData(0, 0, "(0:10]:9");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:2");
622 623 624

        tdSql.query('select histogram(col_float, "user_input", "[-10,10,20,100]", 0) from stb;')
        tdSql.checkRows(3);
625 626 627
        tdSql.checkData(0, 0, "(-10:10]:11");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:2");
628 629
        tdSql.query('select histogram(col_float, "user_input", "[-10,10,20,100]", 0) from ctb;')
        tdSql.checkRows(3);
630 631 632
        tdSql.checkData(0, 0, "(-10:10]:11");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:2");
633 634
        tdSql.query('select histogram(col_float, "user_input", "[-10,10,20,100]", 0) from tb;')
        tdSql.checkRows(3);
635 636 637
        tdSql.checkData(0, 0, "(-10:10]:11");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:2");
638 639 640

        tdSql.query('select histogram(col_float, "user_input", "[-9.4,9.6,20.4,99.9]", 0) from stb;')
        tdSql.checkRows(3);
641 642 643
        tdSql.checkData(0, 0, "(-9.4:9.6]:10");
        tdSql.checkData(1, 0, "(9.6:20.4]:2");
        tdSql.checkData(2, 0, "(20.4:99.9]:2");
644 645
        tdSql.query('select histogram(col_float, "user_input", "[-9.4,9.6,20.4,99.9]", 0) from ctb;')
        tdSql.checkRows(3);
646 647 648
        tdSql.checkData(0, 0, "(-9.4:9.6]:10");
        tdSql.checkData(1, 0, "(9.6:20.4]:2");
        tdSql.checkData(2, 0, "(20.4:99.9]:2");
649 650
        tdSql.query('select histogram(col_float, "user_input", "[-9.4,9.6,20.4,99.9]", 0) from tb;')
        tdSql.checkRows(3);
651 652 653
        tdSql.checkData(0, 0, "(-9.4:9.6]:10");
        tdSql.checkData(1, 0, "(9.6:20.4]:2");
        tdSql.checkData(2, 0, "(20.4:99.9]:2");
654 655 656 657


        tdSql.query('select histogram(col_float, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from stb;')
        tdSql.checkRows(3);
658 659 660
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
661 662
        tdSql.query('select histogram(col_float, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from ctb;')
        tdSql.checkRows(3);
663 664 665
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
666 667
        tdSql.query('select histogram(col_float, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from tb;')
        tdSql.checkRows(3);
668 669 670
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
671 672 673 674

        #DOUBLE
        tdSql.query('select histogram(col_double, "user_input", "[1,3,5]", 0) from stb;')
        tdSql.checkRows(2);
675 676
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
677 678
        tdSql.query('select histogram(col_double, "user_input", "[1,3,5]", 0) from ctb;')
        tdSql.checkRows(2);
679 680
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
681 682
        tdSql.query('select histogram(col_double, "user_input", "[1,3,5]", 0) from tb;')
        tdSql.checkRows(2);
683 684
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
685 686 687

        tdSql.query('select histogram(col_double, "user_input", "[1,3,5,7]", 0) from stb;')
        tdSql.checkRows(3);
688 689 690
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
691 692
        tdSql.query('select histogram(col_double, "user_input", "[1,3,5,7]", 0) from ctb;')
        tdSql.checkRows(3);
693 694 695
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
696 697
        tdSql.query('select histogram(col_double, "user_input", "[1,3,5,7]", 0) from tb;')
        tdSql.checkRows(3);
698 699 700
        tdSql.checkData(0, 0, "(1:3]:2");
        tdSql.checkData(1, 0, "(3:5]:2");
        tdSql.checkData(2, 0, "(5:7]:2");
701 702 703

        tdSql.query('select histogram(col_double, "user_input", "[0,10,20,100]", 0) from stb;')
        tdSql.checkRows(3);
704 705 706
        tdSql.checkData(0, 0, "(0:10]:9");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:2");
707 708
        tdSql.query('select histogram(col_double, "user_input", "[0,10,20,100]", 0) from ctb;')
        tdSql.checkRows(3);
709 710 711
        tdSql.checkData(0, 0, "(0:10]:9");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:2");
712 713
        tdSql.query('select histogram(col_double, "user_input", "[0,10,20,100]", 0) from tb;')
        tdSql.checkRows(3);
714 715 716
        tdSql.checkData(0, 0, "(0:10]:9");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:2");
717 718 719

        tdSql.query('select histogram(col_double, "user_input", "[-10,10,20,100]", 0) from stb;')
        tdSql.checkRows(3);
720 721 722
        tdSql.checkData(0, 0, "(-10:10]:11");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:2");
723 724
        tdSql.query('select histogram(col_double, "user_input", "[-10,10,20,100]", 0) from ctb;')
        tdSql.checkRows(3);
725 726 727
        tdSql.checkData(0, 0, "(-10:10]:11");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:2");
728 729
        tdSql.query('select histogram(col_double, "user_input", "[-10,10,20,100]", 0) from tb;')
        tdSql.checkRows(3);
730 731 732
        tdSql.checkData(0, 0, "(-10:10]:11");
        tdSql.checkData(1, 0, "(10:20]:2");
        tdSql.checkData(2, 0, "(20:100]:2");
733 734 735

        tdSql.query('select histogram(col_double, "user_input", "[-9.4,9.6,20.4,99.9]", 0) from stb;')
        tdSql.checkRows(3);
736 737 738
        tdSql.checkData(0, 0, "(-9.4:9.6]:10");
        tdSql.checkData(1, 0, "(9.6:20.4]:2");
        tdSql.checkData(2, 0, "(20.4:99.9]:2");
739 740
        tdSql.query('select histogram(col_double, "user_input", "[-9.4,9.6,20.4,99.9]", 0) from ctb;')
        tdSql.checkRows(3);
741 742 743
        tdSql.checkData(0, 0, "(-9.4:9.6]:10");
        tdSql.checkData(1, 0, "(9.6:20.4]:2");
        tdSql.checkData(2, 0, "(20.4:99.9]:2");
744 745
        tdSql.query('select histogram(col_double, "user_input", "[-9.4,9.6,20.4,99.9]", 0) from tb;')
        tdSql.checkRows(3);
746 747 748
        tdSql.checkData(0, 0, "(-9.4:9.6]:10");
        tdSql.checkData(1, 0, "(9.6:20.4]:2");
        tdSql.checkData(2, 0, "(20.4:99.9]:2");
749 750 751 752


        tdSql.query('select histogram(col_double, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from stb;')
        tdSql.checkRows(3);
753 754 755
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
756 757
        tdSql.query('select histogram(col_double, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from ctb;')
        tdSql.checkRows(3);
758 759 760
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
761 762
        tdSql.query('select histogram(col_double, "user_input", "[-99999999999999,9.9,19.9,99999999999999]", 0) from tb;')
        tdSql.checkRows(3);
763 764 765
        tdSql.checkData(0, 0, "(-1e+14:9.9]:11");
        tdSql.checkData(1, 0, "(9.9:19.9]:2");
        tdSql.checkData(2, 0, "(19.9:1e+14]:2");
766

767
        #ERROR CASE
768 769 770 771 772 773 774 775 776 777 778 779
        tdSql.error('select histogram(col_double, 1, "[1,5,3,7]", 0) from stb;')
        tdSql.error('select histogram(col_double, 1, "[1,5,3,7]", 0) from ctb;')
        tdSql.error('select histogram(col_double, 1, "[1,5,3,7]", 0) from tb;')
        tdSql.error('select histogram(col_double, -1.0, "[1,5,3,7]", 0) from stb;')
        tdSql.error('select histogram(col_double, -1.0, "[1,5,3,7]", 0) from ctb;')
        tdSql.error('select histogram(col_double, -1.0, "[1,5,3,7]", 0) from tb;')
        tdSql.error('select histogram(col_double, true, "[1,5,3,7]", 0) from stb;')
        tdSql.error('select histogram(col_double, false, "[1,5,3,7]", 0) from ctb;')
        tdSql.error('select histogram(col_double, true, "[1,5,3,7]", 0) from tb;')
        tdSql.error('select histogram(col_double, "user", "[1,5,3,7]", 0) from stb;')
        tdSql.error('select histogram(col_double, "user", "[1,5,3,7]", 0) from ctb;')
        tdSql.error('select histogram(col_double, "user", "[1,5,3,7]", 0) from tb;')
780
        tdSql.error('select histogram(col_double, "user_input", "[1,5,3,7]", 0) from stb;')
781 782
        tdSql.error('select histogram(col_double, "user_input", "[1,5,3,7]", 0) from ctb;')
        tdSql.error('select histogram(col_double, "user_input", "[1,5,3,7]", 0) from tb;')
783
        tdSql.error('select histogram(col_double, "user_input", "[1,-1,3,-3]", 0) from stb;')
784 785
        tdSql.error('select histogram(col_double, "user_input", "[1,-1,3,-3]", 0) from ctb;')
        tdSql.error('select histogram(col_double, "user_input", "[1,-1,3,-3]", 0) from tb;')
786
        tdSql.error('select histogram(col_double, "user_input", "[1.0,5.5,3.3,7.7]", 0) from stb;')
787 788
        tdSql.error('select histogram(col_double, "user_input", "[1.0,5.5,3.3,7.7]", 0) from ctb;')
        tdSql.error('select histogram(col_double, "user_input", "[1.0,5.5,3.3,7.7]", 0) from tb;')
789
        tdSql.error('select histogram(col_double, "user_input", "[1,1,1]", 0) from stb;')
790 791 792 793 794
        tdSql.error('select histogram(col_double, "user_input", "[1,1,1]", 0) from ctb;')
        tdSql.error('select histogram(col_double, "user_input", "[1,1,1]", 0) from tb;')
        tdSql.error('select histogram(col_double, "user_input", "[-1,-1,1]", 0) from stb;')
        tdSql.error('select histogram(col_double, "user_input", "[-1,-1,1]", 0) from ctb;')
        tdSql.error('select histogram(col_double, "user_input", "[-1,-1,1]", 0) from tb;')
795
        tdSql.error('select histogram(col_double, "user_input", "[false,3,5]", 0) from stb;')
796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818
        tdSql.error('select histogram(col_double, "user_input", "[false,3,5]", 0) from ctb;')
        tdSql.error('select histogram(col_double, "user_input", "[false,3,5]", 0) from tb;')
        tdSql.error('select histogram(col_double, "user_input", "[1,true,5]", 0) from stb;')
        tdSql.error('select histogram(col_double, "user_input", "[1,true,5]", 0) from ctb;')
        tdSql.error('select histogram(col_double, "user_input", "[1,true,5]", 0) from tb;')
        tdSql.error('select histogram(col_double, "user_input", "[1.0,"abc",5]", 0) from stb;')
        tdSql.error('select histogram(col_double, "user_input", "[1.0,"abc",5]", 0) from ctb;')
        tdSql.error('select histogram(col_double, "user_input", "[1.0,"abc",5]", 0) from tb;')
        tdSql.error('select histogram(col_double, "user_input", "[1.0, 5, "中文"]", 0) from stb;')
        tdSql.error('select histogram(col_double, "user_input", "[1.0, 5, "中文"]", 0) from ctb;')
        tdSql.error('select histogram(col_double, "user_input", "[1.0, 5, "中文"]", 0) from tb;')
        tdSql.error('select histogram(col_double, "user_input", "{1.0, 3.0, 5.0}", 0) from stb;')
        tdSql.error('select histogram(col_double, "user_input", "{1.0, 3.0, 5.0}", 0) from ctb;')
        tdSql.error('select histogram(col_double, "user_input", "{1.0, 3.0, 5.0}", 0) from tb;')
        tdSql.error('select histogram(col_double, \'user_input\', \'{"start": 1.0, "width": 3.0, "count": 5, "infinity": true}\', 0) from stb;')
        tdSql.error('select histogram(col_double, \'user_input\', \'{"start": 1.0, "width": 3.0, "count": 5, "infinity": true}\', 0) from ctb;')
        tdSql.error('select histogram(col_double, \'user_input\', \'{"start": 1.0, "width": 3.0, "count": 5, "infinity": true}\', 0) from tb;')
        tdSql.error('select histogram(col_double, \'user_input\', \'{"start": 1.0, "factor": 3.0, "count": 5, "infinity": true}\', 0) from stb;')
        tdSql.error('select histogram(col_double, \'user_input\', \'{"start": 1.0, "factor": 3.0, "count": 5, "infinity": true}\', 0) from ctb;')
        tdSql.error('select histogram(col_double, \'user_input\', \'{"start": 1.0, "factor": 3.0, "count": 5, "infinity": true}\', 0) from tb;')


        ## linear_bins ##
819
        #INTEGER
820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 1, "width": 3, "count": 8, "infinity": false}\', 0) from stb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(1:4]:3");
        tdSql.checkData(1, 0, "(4:7]:3");
        tdSql.checkData(2, 0, "(7:10]:3");
        tdSql.checkData(3, 0, "(10:13]:0");
        tdSql.checkData(4, 0, "(13:16]:1");
        tdSql.checkData(5, 0, "(16:19]:0");
        tdSql.checkData(6, 0, "(19:22]:1");
        tdSql.checkData(7, 0, "(22:25]:0");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 1, "width": 3, "count": 8, "infinity": false}\', 0) from ctb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(1:4]:3");
        tdSql.checkData(1, 0, "(4:7]:3");
        tdSql.checkData(2, 0, "(7:10]:3");
        tdSql.checkData(3, 0, "(10:13]:0");
        tdSql.checkData(4, 0, "(13:16]:1");
        tdSql.checkData(5, 0, "(16:19]:0");
        tdSql.checkData(6, 0, "(19:22]:1");
        tdSql.checkData(7, 0, "(22:25]:0");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 1, "width": 3, "count": 8, "infinity": false}\', 0) from tb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(1:4]:3");
        tdSql.checkData(1, 0, "(4:7]:3");
        tdSql.checkData(2, 0, "(7:10]:3");
        tdSql.checkData(3, 0, "(10:13]:0");
        tdSql.checkData(4, 0, "(13:16]:1");
        tdSql.checkData(5, 0, "(16:19]:0");
        tdSql.checkData(6, 0, "(19:22]:1");
        tdSql.checkData(7, 0, "(22:25]:0");

        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -10.0, "width": 3.0, "count": 8, "infinity": false}\', 0) from stb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(-10:-7]:1");
        tdSql.checkData(1, 0, "(-7:-4]:0");
        tdSql.checkData(2, 0, "(-4:-1]:1");
        tdSql.checkData(3, 0, "(-1:2]:2");
        tdSql.checkData(4, 0, "(2:5]:3");
        tdSql.checkData(5, 0, "(5:8]:3");
        tdSql.checkData(6, 0, "(8:11]:2");
        tdSql.checkData(7, 0, "(11:14]:0");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -10.0, "width": 3.0, "count": 8, "infinity": false}\', 0) from ctb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(-10:-7]:1");
        tdSql.checkData(1, 0, "(-7:-4]:0");
        tdSql.checkData(2, 0, "(-4:-1]:1");
        tdSql.checkData(3, 0, "(-1:2]:2");
        tdSql.checkData(4, 0, "(2:5]:3");
        tdSql.checkData(5, 0, "(5:8]:3");
        tdSql.checkData(6, 0, "(8:11]:2");
        tdSql.checkData(7, 0, "(11:14]:0");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -10.0, "width": 3.0, "count": 8, "infinity": false}\', 0) from tb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(-10:-7]:1");
        tdSql.checkData(1, 0, "(-7:-4]:0");
        tdSql.checkData(2, 0, "(-4:-1]:1");
        tdSql.checkData(3, 0, "(-1:2]:2");
        tdSql.checkData(4, 0, "(2:5]:3");
        tdSql.checkData(5, 0, "(5:8]:3");
        tdSql.checkData(6, 0, "(8:11]:2");
        tdSql.checkData(7, 0, "(11:14]:0");

        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -2.5, "width": 0.5, "count": 8, "infinity": false}\', 0) from stb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(-2.5:-2]:0");
        tdSql.checkData(1, 0, "(-2:-1.5]:0");
        tdSql.checkData(2, 0, "(-1.5:-1]:1");
        tdSql.checkData(3, 0, "(-1:-0.5]:0");
        tdSql.checkData(4, 0, "(-0.5:0]:0");
        tdSql.checkData(5, 0, "(0:0.5]:0");
        tdSql.checkData(6, 0, "(0.5:1]:1");
        tdSql.checkData(7, 0, "(1:1.5]:0");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -2.5, "width": 0.5, "count": 8, "infinity": false}\', 0) from ctb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(-2.5:-2]:0");
        tdSql.checkData(1, 0, "(-2:-1.5]:0");
        tdSql.checkData(2, 0, "(-1.5:-1]:1");
        tdSql.checkData(3, 0, "(-1:-0.5]:0");
        tdSql.checkData(4, 0, "(-0.5:0]:0");
        tdSql.checkData(5, 0, "(0:0.5]:0");
        tdSql.checkData(6, 0, "(0.5:1]:1");
        tdSql.checkData(7, 0, "(1:1.5]:0");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -2.5, "width": 0.5, "count": 8, "infinity": false}\', 0) from tb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(-2.5:-2]:0");
        tdSql.checkData(1, 0, "(-2:-1.5]:0");
        tdSql.checkData(2, 0, "(-1.5:-1]:1");
        tdSql.checkData(3, 0, "(-1:-0.5]:0");
        tdSql.checkData(4, 0, "(-0.5:0]:0");
        tdSql.checkData(5, 0, "(0:0.5]:0");
        tdSql.checkData(6, 0, "(0.5:1]:1");
        tdSql.checkData(7, 0, "(1:1.5]:0");

        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 4, "width": -0.5, "count": 10, "infinity": false}\', 0) from stb;')
        tdSql.checkRows(10);
        tdSql.checkData(0, 0, "(3.5:4]:1");
        tdSql.checkData(1, 0, "(3:3.5]:0");
        tdSql.checkData(2, 0, "(2.5:3]:1");
        tdSql.checkData(3, 0, "(2:2.5]:0");
        tdSql.checkData(4, 0, "(1.5:2]:1");
        tdSql.checkData(5, 0, "(1:1.5]:0");
        tdSql.checkData(6, 0, "(0.5:1]:1");
        tdSql.checkData(7, 0, "(0:0.5]:0");
        tdSql.checkData(8, 0, "(-0.5:0]:0");
        tdSql.checkData(9, 0, "(-1:-0.5]:0");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 4, "width": -0.5, "count": 10, "infinity": false}\', 0) from ctb;')
        tdSql.checkRows(10);
        tdSql.checkData(0, 0, "(3.5:4]:1");
        tdSql.checkData(1, 0, "(3:3.5]:0");
        tdSql.checkData(2, 0, "(2.5:3]:1");
        tdSql.checkData(3, 0, "(2:2.5]:0");
        tdSql.checkData(4, 0, "(1.5:2]:1");
        tdSql.checkData(5, 0, "(1:1.5]:0");
        tdSql.checkData(6, 0, "(0.5:1]:1");
        tdSql.checkData(7, 0, "(0:0.5]:0");
        tdSql.checkData(8, 0, "(-0.5:0]:0");
        tdSql.checkData(9, 0, "(-1:-0.5]:0");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 4, "width": -0.5, "count": 10, "infinity": false}\', 0) from tb;')
        tdSql.checkRows(10);
        tdSql.checkData(0, 0, "(3.5:4]:1");
        tdSql.checkData(1, 0, "(3:3.5]:0");
        tdSql.checkData(2, 0, "(2.5:3]:1");
        tdSql.checkData(3, 0, "(2:2.5]:0");
        tdSql.checkData(4, 0, "(1.5:2]:1");
        tdSql.checkData(5, 0, "(1:1.5]:0");
        tdSql.checkData(6, 0, "(0.5:1]:1");
        tdSql.checkData(7, 0, "(0:0.5]:0");
        tdSql.checkData(8, 0, "(-0.5:0]:0");
        tdSql.checkData(9, 0, "(-1:-0.5]:0");

        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 1, "width": 0.5, "count": 1.9999, "infinity": false}\', 0) from stb;')
        tdSql.checkRows(1);
        tdSql.checkData(0, 0, "(1:1.5]:0");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 1, "width": 0.5, "count": 1.9999, "infinity": false}\', 0) from ctb;')
        tdSql.checkRows(1);
        tdSql.checkData(0, 0, "(1:1.5]:0");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 1, "width": 0.5, "count": 1.9999, "infinity": false}\', 0) from tb;')
        tdSql.checkRows(1);
        tdSql.checkData(0, 0, "(1:1.5]:0");

960
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 1, "width": 0.5, "count": 1.99999999999999999, "infinity": false}\', 0) from stb;')
961
        tdSql.checkRows(2);
962 963
        tdSql.checkData(0, 0, "(1:1.5]:0");
        tdSql.checkData(1, 0, "(1.5:2]:1");
964
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 1, "width": 0.5, "count": 1.99999999999999999, "infinity": false}\', 0) from ctb;')
965
        tdSql.checkRows(2);
966 967
        tdSql.checkData(0, 0, "(1:1.5]:0");
        tdSql.checkData(1, 0, "(1.5:2]:1");
968
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 1, "width": 0.5, "count": 1.99999999999999999, "infinity": false}\', 0) from tb;')
969
        tdSql.checkRows(2);
970 971 972
        tdSql.checkData(0, 0, "(1:1.5]:0");
        tdSql.checkData(1, 0, "(1.5:2]:1");

973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 5, "count": 5, "infinity": true}\', 0) from stb;')
        tdSql.checkRows(7);
        tdSql.checkData(0, 0, "(-1.79769e+308:0]:2");
        tdSql.checkData(1, 0, "(0:5]:5");
        tdSql.checkData(2, 0, "(5:10]:5");
        tdSql.checkData(3, 0, "(10:15]:1");
        tdSql.checkData(4, 0, "(15:20]:1");
        tdSql.checkData(5, 0, "(20:25]:0");
        tdSql.checkData(6, 0, "(25:1.79769e+308]:1");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 5, "count": 5, "infinity": true}\', 0) from ctb;')
        tdSql.checkRows(7);
        tdSql.checkData(0, 0, "(-1.79769e+308:0]:2");
        tdSql.checkData(1, 0, "(0:5]:5");
        tdSql.checkData(2, 0, "(5:10]:5");
        tdSql.checkData(3, 0, "(10:15]:1");
        tdSql.checkData(4, 0, "(15:20]:1");
        tdSql.checkData(5, 0, "(20:25]:0");
        tdSql.checkData(6, 0, "(25:1.79769e+308]:1");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 5, "count": 5, "infinity": true}\', 0) from tb;')
        tdSql.checkRows(7);
        tdSql.checkData(0, 0, "(-1.79769e+308:0]:2");
        tdSql.checkData(1, 0, "(0:5]:5");
        tdSql.checkData(2, 0, "(5:10]:5");
        tdSql.checkData(3, 0, "(10:15]:1");
        tdSql.checkData(4, 0, "(15:20]:1");
        tdSql.checkData(5, 0, "(20:25]:0");
        tdSql.checkData(6, 0, "(25:1.79769e+308]:1");

        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -1.76e+308, "width": 5, "count": 1, "infinity": true}\', 0) from stb;')
        tdSql.checkRows(3);
        tdSql.checkData(0, 0, "(-1.79769e+308:-1.76e+308]:0");
        tdSql.checkData(1, 0, "(-1.76e+308:-1.76e+308]:0");
        tdSql.checkData(2, 0, "(-1.76e+308:1.79769e+308]:15");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -1.76e+308, "width": 5, "count": 1, "infinity": true}\', 0) from ctb;')
        tdSql.checkRows(3);
        tdSql.checkData(0, 0, "(-1.79769e+308:-1.76e+308]:0");
        tdSql.checkData(1, 0, "(-1.76e+308:-1.76e+308]:0");
        tdSql.checkData(2, 0, "(-1.76e+308:1.79769e+308]:15");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -1.76e+308, "width": 5, "count": 1, "infinity": true}\', 0) from tb;')
        tdSql.checkRows(3);
        tdSql.checkData(0, 0, "(-1.79769e+308:-1.76e+308]:0");
        tdSql.checkData(1, 0, "(-1.76e+308:-1.76e+308]:0");
        tdSql.checkData(2, 0, "(-1.76e+308:1.79769e+308]:15");

1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -0.7e+308, "width": 0.7e+308, "count": 2, "infinity": false}\', 0) from stb;')
        tdSql.checkRows(2);
        tdSql.checkData(0, 0, "(-7e+307:0]:2");
        tdSql.checkData(1, 0, "(0:7e+307]:13");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -0.7e+308, "width": 0.7e+308, "count": 2, "infinity": false}\', 0) from ctb;')
        tdSql.checkRows(2);
        tdSql.checkData(0, 0, "(-7e+307:0]:2");
        tdSql.checkData(1, 0, "(0:7e+307]:13");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -0.7e+308, "width": 0.7e+308, "count": 2, "infinity": false}\', 0) from tb;')
        tdSql.checkRows(2);
        tdSql.checkData(0, 0, "(-7e+307:0]:2");
        tdSql.checkData(1, 0, "(0:7e+307]:13");

        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -0.7e+308, "width": 0.7e+308, "count": 2, "infinity": true}\', 0) from stb;')
        tdSql.checkRows(4);
        tdSql.checkData(0, 0, "(-1.79769e+308:-7e+307]:0");
        tdSql.checkData(1, 0, "(-7e+307:0]:2");
        tdSql.checkData(2, 0, "(0:7e+307]:13");
        tdSql.checkData(3, 0, "(7e+307:1.79769e+308]:0");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -0.7e+308, "width": 0.7e+308, "count": 2, "infinity": true}\', 0) from ctb;')
        tdSql.checkRows(4);
        tdSql.checkData(0, 0, "(-1.79769e+308:-7e+307]:0");
        tdSql.checkData(1, 0, "(-7e+307:0]:2");
        tdSql.checkData(2, 0, "(0:7e+307]:13");
        tdSql.checkData(3, 0, "(7e+307:1.79769e+308]:0");
        tdSql.query('select histogram(col_tinyint, \'linear_bin\', \'{"start": -0.7e+308, "width": 0.7e+308, "count": 2, "infinity": true}\', 0) from tb;')
        tdSql.checkRows(4);
        tdSql.checkData(0, 0, "(-1.79769e+308:-7e+307]:0");
        tdSql.checkData(1, 0, "(-7e+307:0]:2");
        tdSql.checkData(2, 0, "(0:7e+307]:13");
        tdSql.checkData(3, 0, "(7e+307:1.79769e+308]:0");
1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277

        #FLOATING NUMBER
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 1, "width": 3, "count": 8, "infinity": false}\', 0) from stb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(1:4]:3");
        tdSql.checkData(1, 0, "(4:7]:3");
        tdSql.checkData(2, 0, "(7:10]:3");
        tdSql.checkData(3, 0, "(10:13]:1");
        tdSql.checkData(4, 0, "(13:16]:1");
        tdSql.checkData(5, 0, "(16:19]:0");
        tdSql.checkData(6, 0, "(19:22]:1");
        tdSql.checkData(7, 0, "(22:25]:0");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 1, "width": 3, "count": 8, "infinity": false}\', 0) from ctb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(1:4]:3");
        tdSql.checkData(1, 0, "(4:7]:3");
        tdSql.checkData(2, 0, "(7:10]:3");
        tdSql.checkData(3, 0, "(10:13]:1");
        tdSql.checkData(4, 0, "(13:16]:1");
        tdSql.checkData(5, 0, "(16:19]:0");
        tdSql.checkData(6, 0, "(19:22]:1");
        tdSql.checkData(7, 0, "(22:25]:0");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 1, "width": 3, "count": 8, "infinity": false}\', 0) from tb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(1:4]:3");
        tdSql.checkData(1, 0, "(4:7]:3");
        tdSql.checkData(2, 0, "(7:10]:3");
        tdSql.checkData(3, 0, "(10:13]:1");
        tdSql.checkData(4, 0, "(13:16]:1");
        tdSql.checkData(5, 0, "(16:19]:0");
        tdSql.checkData(6, 0, "(19:22]:1");
        tdSql.checkData(7, 0, "(22:25]:0");

        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -10.0, "width": 3.0, "count": 8, "infinity": false}\', 0) from stb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(-10:-7]:1");
        tdSql.checkData(1, 0, "(-7:-4]:0");
        tdSql.checkData(2, 0, "(-4:-1]:1");
        tdSql.checkData(3, 0, "(-1:2]:1");
        tdSql.checkData(4, 0, "(2:5]:3");
        tdSql.checkData(5, 0, "(5:8]:3");
        tdSql.checkData(6, 0, "(8:11]:3");
        tdSql.checkData(7, 0, "(11:14]:0");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -10.0, "width": 3.0, "count": 8, "infinity": false}\', 0) from ctb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(-10:-7]:1");
        tdSql.checkData(1, 0, "(-7:-4]:0");
        tdSql.checkData(2, 0, "(-4:-1]:1");
        tdSql.checkData(3, 0, "(-1:2]:1");
        tdSql.checkData(4, 0, "(2:5]:3");
        tdSql.checkData(5, 0, "(5:8]:3");
        tdSql.checkData(6, 0, "(8:11]:3");
        tdSql.checkData(7, 0, "(11:14]:0");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -10.0, "width": 3.0, "count": 8, "infinity": false}\', 0) from tb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(-10:-7]:1");
        tdSql.checkData(1, 0, "(-7:-4]:0");
        tdSql.checkData(2, 0, "(-4:-1]:1");
        tdSql.checkData(3, 0, "(-1:2]:1");
        tdSql.checkData(4, 0, "(2:5]:3");
        tdSql.checkData(5, 0, "(5:8]:3");
        tdSql.checkData(6, 0, "(8:11]:3");
        tdSql.checkData(7, 0, "(11:14]:0");

        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -2.5, "width": 0.5, "count": 8, "infinity": false}\', 0) from stb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(-2.5:-2]:0");
        tdSql.checkData(1, 0, "(-2:-1.5]:1");
        tdSql.checkData(2, 0, "(-1.5:-1]:0");
        tdSql.checkData(3, 0, "(-1:-0.5]:0");
        tdSql.checkData(4, 0, "(-0.5:0]:0");
        tdSql.checkData(5, 0, "(0:0.5]:0");
        tdSql.checkData(6, 0, "(0.5:1]:1");
        tdSql.checkData(7, 0, "(1:1.5]:0");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -2.5, "width": 0.5, "count": 8, "infinity": false}\', 0) from ctb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(-2.5:-2]:0");
        tdSql.checkData(1, 0, "(-2:-1.5]:1");
        tdSql.checkData(2, 0, "(-1.5:-1]:0");
        tdSql.checkData(3, 0, "(-1:-0.5]:0");
        tdSql.checkData(4, 0, "(-0.5:0]:0");
        tdSql.checkData(5, 0, "(0:0.5]:0");
        tdSql.checkData(6, 0, "(0.5:1]:1");
        tdSql.checkData(7, 0, "(1:1.5]:0");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -2.5, "width": 0.5, "count": 8, "infinity": false}\', 0) from tb;')
        tdSql.checkRows(8);
        tdSql.checkData(0, 0, "(-2.5:-2]:0");
        tdSql.checkData(1, 0, "(-2:-1.5]:1");
        tdSql.checkData(2, 0, "(-1.5:-1]:0");
        tdSql.checkData(3, 0, "(-1:-0.5]:0");
        tdSql.checkData(4, 0, "(-0.5:0]:0");
        tdSql.checkData(5, 0, "(0:0.5]:0");
        tdSql.checkData(6, 0, "(0.5:1]:1");
        tdSql.checkData(7, 0, "(1:1.5]:0");

        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 4, "width": -0.5, "count": 10, "infinity": false}\', 0) from stb;')
        tdSql.checkRows(10);
        tdSql.checkData(0, 0, "(3.5:4]:0");
        tdSql.checkData(1, 0, "(3:3.5]:1");
        tdSql.checkData(2, 0, "(2.5:3]:0");
        tdSql.checkData(3, 0, "(2:2.5]:1");
        tdSql.checkData(4, 0, "(1.5:2]:0");
        tdSql.checkData(5, 0, "(1:1.5]:1");
        tdSql.checkData(6, 0, "(0.5:1]:0");
        tdSql.checkData(7, 0, "(0:0.5]:0");
        tdSql.checkData(8, 0, "(-0.5:0]:0");
        tdSql.checkData(9, 0, "(-1:-0.5]:0");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 4, "width": -0.5, "count": 10, "infinity": false}\', 0) from ctb;')
        tdSql.checkRows(10);
        tdSql.checkData(0, 0, "(3.5:4]:0");
        tdSql.checkData(1, 0, "(3:3.5]:1");
        tdSql.checkData(2, 0, "(2.5:3]:0");
        tdSql.checkData(3, 0, "(2:2.5]:1");
        tdSql.checkData(4, 0, "(1.5:2]:0");
        tdSql.checkData(5, 0, "(1:1.5]:1");
        tdSql.checkData(6, 0, "(0.5:1]:0");
        tdSql.checkData(7, 0, "(0:0.5]:0");
        tdSql.checkData(8, 0, "(-0.5:0]:0");
        tdSql.checkData(9, 0, "(-1:-0.5]:0");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 4, "width": -0.5, "count": 10, "infinity": false}\', 0) from tb;')
        tdSql.checkRows(10);
        tdSql.checkData(0, 0, "(3.5:4]:0");
        tdSql.checkData(1, 0, "(3:3.5]:1");
        tdSql.checkData(2, 0, "(2.5:3]:0");
        tdSql.checkData(3, 0, "(2:2.5]:1");
        tdSql.checkData(4, 0, "(1.5:2]:0");
        tdSql.checkData(5, 0, "(1:1.5]:1");
        tdSql.checkData(6, 0, "(0.5:1]:0");
        tdSql.checkData(7, 0, "(0:0.5]:0");
        tdSql.checkData(8, 0, "(-0.5:0]:0");
        tdSql.checkData(9, 0, "(-1:-0.5]:0");

        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 1, "width": 0.5, "count": 1.9999, "infinity": false}\', 0) from stb;')
        tdSql.checkRows(1);
        tdSql.checkData(0, 0, "(1:1.5]:1");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 1, "width": 0.5, "count": 1.9999, "infinity": false}\', 0) from ctb;')
        tdSql.checkRows(1);
        tdSql.checkData(0, 0, "(1:1.5]:1");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 1, "width": 0.5, "count": 1.9999, "infinity": false}\', 0) from tb;')
        tdSql.checkRows(1);
        tdSql.checkData(0, 0, "(1:1.5]:1");

        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 1, "width": 0.5, "count": 1.99999999999999999, "infinity": false}\', 0) from stb;')
        tdSql.checkRows(2);
        tdSql.checkData(0, 0, "(1:1.5]:1");
        tdSql.checkData(1, 0, "(1.5:2]:0");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 1, "width": 0.5, "count": 1.99999999999999999, "infinity": false}\', 0) from ctb;')
        tdSql.checkRows(2);
        tdSql.checkData(0, 0, "(1:1.5]:1");
        tdSql.checkData(1, 0, "(1.5:2]:0");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 1, "width": 0.5, "count": 1.99999999999999999, "infinity": false}\', 0) from tb;')
        tdSql.checkRows(2);
        tdSql.checkData(0, 0, "(1:1.5]:1");
        tdSql.checkData(1, 0, "(1.5:2]:0");

        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 0, "width": 5, "count": 5, "infinity": true}\', 0) from stb;')
        tdSql.checkRows(7);
        tdSql.checkData(0, 0, "(-1.79769e+308:0]:2");
        tdSql.checkData(1, 0, "(0:5]:4");
        tdSql.checkData(2, 0, "(5:10]:5");
        tdSql.checkData(3, 0, "(10:15]:1");
        tdSql.checkData(4, 0, "(15:20]:1");
        tdSql.checkData(5, 0, "(20:25]:1");
        tdSql.checkData(6, 0, "(25:1.79769e+308]:1");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 0, "width": 5, "count": 5, "infinity": true}\', 0) from ctb;')
        tdSql.checkRows(7);
        tdSql.checkData(0, 0, "(-1.79769e+308:0]:2");
        tdSql.checkData(1, 0, "(0:5]:4");
        tdSql.checkData(2, 0, "(5:10]:5");
        tdSql.checkData(3, 0, "(10:15]:1");
        tdSql.checkData(4, 0, "(15:20]:1");
        tdSql.checkData(5, 0, "(20:25]:1");
        tdSql.checkData(6, 0, "(25:1.79769e+308]:1");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": 0, "width": 5, "count": 5, "infinity": true}\', 0) from tb;')
        tdSql.checkRows(7);
        tdSql.checkData(0, 0, "(-1.79769e+308:0]:2");
        tdSql.checkData(1, 0, "(0:5]:4");
        tdSql.checkData(2, 0, "(5:10]:5");
        tdSql.checkData(3, 0, "(10:15]:1");
        tdSql.checkData(4, 0, "(15:20]:1");
        tdSql.checkData(5, 0, "(20:25]:1");
        tdSql.checkData(6, 0, "(25:1.79769e+308]:1");

        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -1.76e+308, "width": 5, "count": 1, "infinity": true}\', 0) from stb;')
        tdSql.checkRows(3);
        tdSql.checkData(0, 0, "(-1.79769e+308:-1.76e+308]:0");
        tdSql.checkData(1, 0, "(-1.76e+308:-1.76e+308]:0");
        tdSql.checkData(2, 0, "(-1.76e+308:1.79769e+308]:15");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -1.76e+308, "width": 5, "count": 1, "infinity": true}\', 0) from ctb;')
        tdSql.checkRows(3);
        tdSql.checkData(0, 0, "(-1.79769e+308:-1.76e+308]:0");
        tdSql.checkData(1, 0, "(-1.76e+308:-1.76e+308]:0");
        tdSql.checkData(2, 0, "(-1.76e+308:1.79769e+308]:15");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -1.76e+308, "width": 5, "count": 1, "infinity": true}\', 0) from tb;')
        tdSql.checkRows(3);
        tdSql.checkData(0, 0, "(-1.79769e+308:-1.76e+308]:0");
        tdSql.checkData(1, 0, "(-1.76e+308:-1.76e+308]:0");
        tdSql.checkData(2, 0, "(-1.76e+308:1.79769e+308]:15");

        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -0.7e+308, "width": 0.7e+308, "count": 2, "infinity": false}\', 0) from stb;')
        tdSql.checkRows(2);
        tdSql.checkData(0, 0, "(-7e+307:0]:2");
        tdSql.checkData(1, 0, "(0:7e+307]:13");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -0.7e+308, "width": 0.7e+308, "count": 2, "infinity": false}\', 0) from ctb;')
        tdSql.checkRows(2);
        tdSql.checkData(0, 0, "(-7e+307:0]:2");
        tdSql.checkData(1, 0, "(0:7e+307]:13");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -0.7e+308, "width": 0.7e+308, "count": 2, "infinity": false}\', 0) from tb;')
        tdSql.checkRows(2);
        tdSql.checkData(0, 0, "(-7e+307:0]:2");
        tdSql.checkData(1, 0, "(0:7e+307]:13");

        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -0.7e+308, "width": 0.7e+308, "count": 2, "infinity": true}\', 0) from stb;')
        tdSql.checkRows(4);
        tdSql.checkData(0, 0, "(-1.79769e+308:-7e+307]:0");
        tdSql.checkData(1, 0, "(-7e+307:0]:2");
        tdSql.checkData(2, 0, "(0:7e+307]:13");
        tdSql.checkData(3, 0, "(7e+307:1.79769e+308]:0");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -0.7e+308, "width": 0.7e+308, "count": 2, "infinity": true}\', 0) from ctb;')
        tdSql.checkRows(4);
        tdSql.checkData(0, 0, "(-1.79769e+308:-7e+307]:0");
        tdSql.checkData(1, 0, "(-7e+307:0]:2");
        tdSql.checkData(2, 0, "(0:7e+307]:13");
        tdSql.checkData(3, 0, "(7e+307:1.79769e+308]:0");
        tdSql.query('select histogram(col_float, \'linear_bin\', \'{"start": -0.7e+308, "width": 0.7e+308, "count": 2, "infinity": true}\', 0) from tb;')
        tdSql.checkRows(4);
        tdSql.checkData(0, 0, "(-1.79769e+308:-7e+307]:0");
        tdSql.checkData(1, 0, "(-7e+307:0]:2");
        tdSql.checkData(2, 0, "(0:7e+307]:13");
        tdSql.checkData(3, 0, "(7e+307:1.79769e+308]:0");
1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294

        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": true, "width": 5, "count": 5, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": false, "width": 5, "count": 5, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": "abc", "width": 5, "count": 5, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": "中文", "width": 5, "count": 5, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": abc, "width": 5, "count": 5, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": -1.80e+308, "width": 5, "count": 5, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 1.80e+308, "width": 5, "count": 5, "infinity": false}\', 0) from stb;')

        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": true, "count": 5, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": false, "count": 5, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": "abc", "count": 5, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": "中文", "count": 5, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": abc, "count": 5, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 0, "count": 5, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": -1.80e+308, "count": 5, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1.80e+308, "count": 5, "infinity": false}\', 0) from stb;')
1295

1296 1297 1298 1299 1300 1301 1302 1303 1304 1305
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": -1.4e+308, "width": 1.4e+308, "count": 3, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": -1.4e+308, "width": 1.4e+308, "count": 3, "infinity": true}\', 0) from stb;')

        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": -1, "infinity": false}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 0, "infinity": true}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": true, "infinity": true}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": false, "infinity": true}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": "abc", "infinity": true}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": "中文", "infinity": true}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": abc, "infinity": true}\', 0) from stb;')
1306 1307 1308 1309 1310 1311 1312 1313 1314 1315
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1.8e+308, "infinity": true}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": -1.8e+308, "infinity": true}\', 0) from stb;')

        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": 1}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": 0}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": -1.5}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": 1.8e+308}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": "abc"}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": "中文"}\', 0) from stb;')
        tdSql.error('select histogram(col_tinyint, \'linear_bin\', \'{"start": 0, "width": 1, "count": 1, "infinity": abc}\', 0) from stb;')
1316

1317 1318 1319 1320 1321 1322 1323 1324 1325
        return
        tdSql.execute('drop database db')
    def stop(self):
        tdSql.close()
        tdLog.success("%s successfully executed" % __file__)


tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())