[feature](jsonb) rename JSONB type name and function name to JSON (#19774)
To be more compatible with MySQL, rename JSONB type name and function name to JSON. The old JSONB type name and jsonb_xx function can still be used for backward compatibility. There is a function jsonb_extract remained since json_extract is used by json string function and more work need to change it. It will be changed further.
This commit is contained in:
@ -48,7 +48,7 @@ public enum PrimitiveType {
|
||||
// 8-byte pointer and 4-byte length indicator (12 bytes total).
|
||||
// Aligning to 8 bytes so 16 total.
|
||||
VARCHAR("VARCHAR", 16, TPrimitiveType.VARCHAR, true),
|
||||
JSONB("JSONB", 16, TPrimitiveType.JSONB, true),
|
||||
JSONB("JSON", 16, TPrimitiveType.JSONB, true),
|
||||
|
||||
DECIMALV2("DECIMALV2", 16, TPrimitiveType.DECIMALV2, true),
|
||||
DECIMAL32("DECIMAL32", 4, TPrimitiveType.DECIMAL32, true),
|
||||
|
||||
@ -240,7 +240,7 @@ public class ScalarType extends Type {
|
||||
return CHAR;
|
||||
case "VARCHAR":
|
||||
return createVarcharType();
|
||||
case "JSONB":
|
||||
case "JSON":
|
||||
return createJsonbType();
|
||||
case "STRING":
|
||||
case "TEXT":
|
||||
@ -548,7 +548,7 @@ public class ScalarType extends Type {
|
||||
} else if (type == PrimitiveType.STRING) {
|
||||
return "TEXT";
|
||||
} else if (type == PrimitiveType.JSONB) {
|
||||
return "JSONB";
|
||||
return "JSON";
|
||||
}
|
||||
return type.toString();
|
||||
}
|
||||
@ -633,7 +633,7 @@ public class ScalarType extends Type {
|
||||
stringBuilder.append("text");
|
||||
break;
|
||||
case JSONB:
|
||||
stringBuilder.append("jsonb");
|
||||
stringBuilder.append("json");
|
||||
break;
|
||||
case ARRAY:
|
||||
stringBuilder.append(type.toString().toLowerCase());
|
||||
|
||||
Reference in New Issue
Block a user