Skip to content

Commit

Permalink
update some debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
amorynan committed Nov 21, 2024
1 parent c2781f5 commit 6ddba03
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 61 deletions.
7 changes: 7 additions & 0 deletions be/src/vec/functions/function_ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,14 @@ class FunctionIsIPAddressInRange : public IFunction {
<< " max: " << max_roaring->cardinality()
<< " result: " << res_roaring->cardinality();
});
LOG(WARNING) << "ip_search:" << data_type_with_name.first << " input_rows:" << num_rows
<< " max_ro:" << max_roaring->toString() << " res_ro:" << res_roaring->toString()
<< " null_bitmap: " << null_bitmap->toString();
segment_v2::InvertedIndexResultBitmap result(res_roaring, null_bitmap);
if (!result.get_data_bitmap()->isEmpty() || !null_bitmap->isEmpty()) {
LOG(FATAL) << "ip.inverted_index_filtered : " << result.get_data_bitmap()->toString() << " null:"
<< result.get_null_bitmap()->toString();
}
bitmap_result = result;
bitmap_result.mask_out_null();
return Status::OK();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,44 +26,8 @@

-- !sql_with_ii_0 --

-- !sql_with_ii_1 --

-- !sql_with_ii_2 --

-- !sql_with_ii_3 --
2 42.117.228.166 2001:16a0:2:200a::2 true

-- !sql_with_ii_4 --

-- !sql_with_ii_5 --
5 255.255.255.255 \N \N

-- !sql_with_ii_6 --

-- !sql_with_ii_7 --

-- !sql_with_ii_8 --

-- !sql_with_ii_9 --

-- !sql --

-- !sql --

-- !sql --

-- !sql --
2 42.117.228.166 2001:16a0:2:200a::2

-- !sql --

-- !sql --
5 255.255.255.255 \N

-- !sql --

-- !sql --

-- !sql --

-- !sql --
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,40 +77,18 @@ suite("test_ip_cidr_search_with_inverted_index", "nonConcurrent"){
// select ipv6 in ipv4 cidr
qt_sql_with_ii_0 """ select id, ipv4, ipv6, is_ip_address_in_range(ipv6, '255.255.255.255/12') from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv6, '255.255.255.255/12') order by id; """
// select ipv6 in ipv6 cidr
qt_sql_with_ii_1 """ select id, ipv4, ipv6, is_ip_address_in_range(ipv6, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/12') from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv6, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/12') order by id; """
qt_sql_with_ii_2 """ select id, ipv4, ipv6, is_ip_address_in_range(ipv6, '::ffff:192.168.0.4/128') from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv6, '::ffff:192.168.0.4/128') order by id; """
qt_sql_with_ii_3 """ select id, ipv4, ipv6, is_ip_address_in_range(ipv6, '2001:16a0:2:200a::2/64') from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv6, '2001:16a0:2:200a::2/64') order by id; """

// select ipv4 in ipv6 cidr
qt_sql_with_ii_4 """ select id, ipv4, ipv6, is_ip_address_in_range(ipv4, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/12') from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv4, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/12') order by id; """
// select ipv4 in ipv4 cidr
qt_sql_with_ii_5 """ select id, ipv4, ipv6, is_ip_address_in_range(ipv6, '255.255.255.255/12') from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv4, '255.255.255.255/12') order by id; """
qt_sql_with_ii_6 """ select id, ipv4, ipv6, is_ip_address_in_range(ipv4, '127.0.0.0/8') from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv4, '127.0.0.0/8') order by id; """
qt_sql_with_ii_7 """ select id, ipv4, ipv6, is_ip_address_in_range(ipv4, '192.168.100.0/24') from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv4, '192.168.100.0/24') order by id; """

// select in null cidr
qt_sql_with_ii_8 """ select id, ipv4, ipv6, is_ip_address_in_range(ipv4, null) from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv4, null) order by id; """
qt_sql_with_ii_9 """ select id, ipv4, ipv6, is_ip_address_in_range(ipv6, null) from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv6, null) order by id; """



def create_sql = {
List<String> list = new ArrayList<>()
// select ipv6 in ipv4 cidr
list.add("select id, ipv4, ipv6 from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv6, '255.255.255.255/12') order by id;")
// select ipv6 in ipv6 cidr
list.add("select id, ipv4, ipv6 from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv6, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/12') order by id;")
list.add("select id, ipv4, ipv6 from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv6, '::ffff:192.168.0.4/128') order by id;")
list.add("select id, ipv4, ipv6 from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv6, '2001:16a0:2:200a::2/64') order by id;")
// select ipv4 in ipv6 cidr
list.add("select id, ipv4, ipv6 from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv4, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/12') order by id;")
// select ipv4 in ipv4 cidr
list.add("select id, ipv4, ipv6 from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv4, '255.255.255.255/12') order by id;")
list.add("select id, ipv4, ipv6 from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv4, '127.0.0.0/8') order by id;")
list.add("select id, ipv4, ipv6 from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv4, '192.168.100.0/24') order by id;")
// select in null cidr
list.add("select id, ipv4, ipv6 from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv4, null) order by id;")
list.add("select id, ipv4, ipv6 from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv6, null) order by id;")
list.add("select id, ipv4, ipv6, is_ip_address_in_range(ipv4, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/12') from tc_ip_cidr_search_with_inverted_index where is_ip_address_in_range(ipv4, 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/12') order by id;")
return list;
}

Expand All @@ -119,8 +97,8 @@ suite("test_ip_cidr_search_with_inverted_index", "nonConcurrent"){
def i = 0
for (sqlStr in sqlList) {
try {
log.info("execute sql: i")
GetDebugPoint().enableDebugPointForAllBEs(checkpoints_name, [req_id: i])
log.info("execute sql: ${i} : ${sqlStr}")
GetDebugPoint().enableDebugPointForAllBEs(checkpoints_name, [req_id: i])
order_qt_sql """ ${sqlStr} """
} finally {
GetDebugPoint().disableDebugPointForAllBEs(checkpoints_name)
Expand Down

0 comments on commit 6ddba03

Please sign in to comment.