[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:
Kang
2023-05-18 16:16:52 +08:00
committed by GitHub
parent a2c9ed7be8
commit 294599ee45
29 changed files with 10090 additions and 438 deletions

View File

@ -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),

View File

@ -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());