Skip to content

Commit

Permalink
test: int type random number range tightened to [0, 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
YamingPei committed Jan 23, 2025
1 parent e1b7bf0 commit 2afdc11
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 30 deletions.
42 changes: 32 additions & 10 deletions tests/taosbenchmark/json/taosc_insert_alltypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,38 @@
"use_sample_ts": "no",
"tags_file": "",
"partial_col_num": 999,
"columns": [{"type": "TIMESTAMP","max": 10, "min": 0},{"type": "INT","max": 10, "min": 0}, {"type": "BIGINT","max": 10, "min": 0}, {"type": "FLOAT","max": 10, "min": 0}, {"type": "DOUBLE","max": 10, "min": 0}, {"type": "SMALLINT","max": 10, "min": 0}, {"type": "TINYINT","max": 10, "min": 0}, {"type": "BOOL","max": 10, "min": 0}, {"type": "NCHAR","len": 29, "count":1,
"values": ["d1", "d2"]
}, {"type": "UINT","max": 10, "min": 0}, {"type": "UBIGINT","max": 10, "min": 0}, {"type": "UTINYINT","max": 10, "min": 0}, {"type": "USMALLINT","max": 10, "min": 0}, {"type": "BINARY", "len": 23, "count":1,
"values": ["b1","b2"]
}],
"tags": [{"type": "TIMESTAMP","max": 10, "min": 0},{"type": "INT","max": 10, "min": 0}, {"type": "BIGINT","max": 10, "min": 0}, {"type": "FLOAT","max": 10, "min": 0}, {"type": "DOUBLE","max": 10, "min": 0}, {"type": "SMALLINT","max": 10, "min": 0}, {"type": "TINYINT","max": 10, "min": 0}, {"type": "BOOL","max": 10, "min": 0}, {"type": "NCHAR","len": 17, "count":1,
"values": ["d1", "d2"]
}, {"type": "UINT","max": 10, "min": 0}, {"type": "UBIGINT","max": 10, "min": 0}, {"type": "UTINYINT","max": 10, "min": 0}, {"type": "USMALLINT","max": 10, "min": 0}, {"type": "BINARY", "len": 19, "count":1,
"values": ["b1","b2"]
}]
"columns": [
{"type": "TIMESTAMP","max": 10, "min": 0},
{"type": "INT","max": 1, "min": 0},
{"type": "BIGINT","max": 10, "min": 0},
{"type": "FLOAT","max": 10, "min": 0},
{"type": "DOUBLE","max": 10, "min": 0},
{"type": "SMALLINT","max": 10, "min": 0},
{"type": "TINYINT","max": 10, "min": 0},
{"type": "BOOL","max": 10, "min": 0},
{"type": "NCHAR","len": 29, "count":1, "values": ["d1", "d2"]},
{"type": "UINT","max": 10, "min": 0},
{"type": "UBIGINT","max": 10, "min": 0},
{"type": "UTINYINT","max": 10, "min": 0},
{"type": "USMALLINT","max": 10, "min": 0},
{"type": "BINARY", "len": 23, "count":1, "values": ["b1","b2"]}
],
"tags": [
{"type": "TIMESTAMP","max": 10, "min": 0},
{"type": "INT","max": 10, "min": 0},
{"type": "BIGINT","max": 10, "min": 0},
{"type": "FLOAT","max": 10, "min": 0},
{"type": "DOUBLE","max": 10, "min": 0},
{"type": "SMALLINT","max": 10, "min": 0},
{"type": "TINYINT","max": 10, "min": 0},
{"type": "BOOL","max": 10, "min": 0},
{"type": "NCHAR","len": 17, "count":1, "values": ["d1", "d2"]},
{"type": "UINT","max": 10, "min": 0},
{"type": "UBIGINT","max": 10, "min": 0},
{"type": "UTINYINT","max": 10, "min": 0},
{"type": "USMALLINT","max": 10, "min": 0},
{"type": "BINARY", "len": 19, "count":1, "values": ["b1","b2"]}
]
}]
}]
}
40 changes: 20 additions & 20 deletions tests/taosbenchmark/taosc_insert_alltypes_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,51 +106,51 @@ def run(self):
# binary/varchar diff in 2.x/3.x
# tdSql.checkData(28, 1, "BINARY")
tdSql.checkData(28, 2, 19)
tdSql.query("select count(*) from db.stb where c1 >= 0 and c1 <= 10")
tdSql.query("select count(*) from db.stb where c1 >= 0 and c1 < 1")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where c2 >= 0 and c2 <= 10")
tdSql.query("select count(*) from db.stb where c2 >= 0 and c2 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where c3 >= 0 and c3 <= 10")
tdSql.query("select count(*) from db.stb where c3 >= 0 and c3 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where c4 >= 0 and c4 <= 10")
tdSql.query("select count(*) from db.stb where c4 >= 0 and c4 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where c5 >= 0 and c5 <= 10")
tdSql.query("select count(*) from db.stb where c5 >= 0 and c5 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where c6 >= 0 and c6 <= 10")
tdSql.query("select count(*) from db.stb where c6 >= 0 and c6 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where c8 = 'd1' or c8 = 'd2'")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where c9 >= 0 and c9 <= 10")
tdSql.query("select count(*) from db.stb where c9 >= 0 and c9 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where c10 >= 0 and c10 <= 10")
tdSql.query("select count(*) from db.stb where c10 >= 0 and c10 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where c11 >= 0 and c11 <= 10")
tdSql.query("select count(*) from db.stb where c11 >= 0 and c11 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where c12 >= 0 and c12 <= 10")
tdSql.query("select count(*) from db.stb where c12 >= 0 and c12 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where c13 = 'b1' or c13 = 'b2'")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where t1 >= 0 and t1 <= 10")
tdSql.query("select count(*) from db.stb where t1 >= 0 and t1 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where t2 >= 0 and t2 <= 10")
tdSql.query("select count(*) from db.stb where t2 >= 0 and t2 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where t3 >= 0 and t3 <= 10")
tdSql.query("select count(*) from db.stb where t3 >= 0 and t3 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where t4 >= 0 and t4 <= 10")
tdSql.query("select count(*) from db.stb where t4 >= 0 and t4 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where t5 >= 0 and t5 <= 10")
tdSql.query("select count(*) from db.stb where t5 >= 0 and t5 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where t6 >= 0 and t6 <= 10")
tdSql.query("select count(*) from db.stb where t6 >= 0 and t6 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where t8 = 'd1' or t8 = 'd2'")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where t9 >= 0 and t9 <= 10")
tdSql.query("select count(*) from db.stb where t9 >= 0 and t9 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where t10 >= 0 and t10 <= 10")
tdSql.query("select count(*) from db.stb where t10 >= 0 and t10 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where t11 >= 0 and t11 <= 10")
tdSql.query("select count(*) from db.stb where t11 >= 0 and t11 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where t12 >= 0 and t12 <= 10")
tdSql.query("select count(*) from db.stb where t12 >= 0 and t12 < 10")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb where t13 = 'b1' or t13 = 'b2'")
tdSql.checkData(0, 0, 160)
Expand Down

0 comments on commit 2afdc11

Please sign in to comment.