pick from master #39318
This commit is contained in:
@ -591,6 +591,14 @@ public enum PrimitiveType {
|
||||
builder.put(VARIANT, STRING);
|
||||
builder.put(VARIANT, JSONB);
|
||||
|
||||
// ipv4
|
||||
builder.put(IPV4, VARCHAR);
|
||||
builder.put(IPV4, STRING);
|
||||
|
||||
// ipv6
|
||||
builder.put(IPV6, VARCHAR);
|
||||
builder.put(IPV6, STRING);
|
||||
|
||||
// HLL
|
||||
builder.put(HLL, HLL);
|
||||
|
||||
|
||||
@ -248,4 +248,20 @@ suite("cast") {
|
||||
sql """select cast(k11 as time) ct from test order by ct;"""
|
||||
exception "cannot cast"
|
||||
}
|
||||
|
||||
// ip
|
||||
|
||||
sql """drop table if exists ip_test"""
|
||||
sql """
|
||||
create table if not exists ip_test (a ipv6, b ipv4) properties ("replication_num" = "1");
|
||||
"""
|
||||
sql """
|
||||
insert into ip_test values('d916:b163:3ce8:e0f3:b953:fa0c:ab21:1ff9', "172.20.48.119");
|
||||
"""
|
||||
|
||||
sql """sync"""
|
||||
|
||||
sql """select ipv6_string_to_num(a), ipv4_string_to_num(b) from ip_test"""
|
||||
sql """drop table if exists ip_test"""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user