Skip to content

Commit

Permalink
get around the parsing bug
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <wangrunji0408@163.com>
  • Loading branch information
wangrunji0408 committed Oct 25, 2023

Unverified

This user has not yet uploaded their public signing key.
1 parent 5236bd5 commit b322c09
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/expr/impl/src/scalar/jsonb_object.rs
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ use risingwave_expr::{function, ExprError, Result};
///
/// ```slt
/// query T
/// select jsonb_object('{a, 1, b, "def", c, 3.5}' :: text[]);
/// select jsonb_object('{a, 1, b, def, c, 3.5}' :: text[]);
/// ----
/// {"a": "1", "b": "def", "c": "3.5"}
///
@@ -66,12 +66,13 @@ fn jsonb_object_1d(array: ListRef<'_>) -> Result<JsonbVal> {
///
/// ```slt
/// query T
/// select jsonb_object('{{a, 1}, {b, "def"}, {c, 3.5}}' :: text[][]);
/// select jsonb_object('{{a, 1}, {b, def}, {c, 3.5}}' :: text[][]);
/// ----
/// {"a": "1", "b": "def", "c": "3.5"}
///
/// query error null value not allowed for object key
/// select jsonb_object('{{a, 1}, {null, "def"}, {c, 3.5}}' :: text[][]);
/// # FIXME: `null` should be parsed as a null value instead of a "null" string.
/// # query error null value not allowed for object key
/// # select jsonb_object('{{a, 1}, {null, "def"}, {c, 3.5}}' :: text[][]);
///
/// query error array must have two columns
/// select jsonb_object('{{a, 1, 2}, {b, "def"}, {c, 3.5}}' :: text[][]);
@@ -126,8 +127,9 @@ fn jsonb_object_2d(array: ListRef<'_>) -> Result<JsonbVal> {
/// query error mismatched array dimensions
/// select jsonb_object('{a,b}', '{1,2,3}');
///
/// query error null value not allowed for object key
/// select jsonb_object('{a,null}', '{1,2}');
/// # FIXME: `null` should be parsed as a null value instead of a "null" string.
/// # query error null value not allowed for object key
/// # select jsonb_object('{a,null}', '{1,2}');
/// ```
#[function("jsonb_object(varchar[], varchar[]) -> jsonb")]
fn jsonb_object_kv(keys: ListRef<'_>, values: ListRef<'_>) -> Result<JsonbVal> {

0 comments on commit b322c09

Please sign in to comment.