starrocks icon indicating copy to clipboard operation
starrocks copied to clipboard

[Bug]Json array element can not insert into array column

Open zhuxt2015 opened this issue 2 years ago • 1 comments

Steps to reproduce the behavior (Required)

CREATE TABLE `test_array` (
  `id` int(11) NULL COMMENT "",
  `a` ARRAY<varchar(65533)> NULL COMMENT ""
) ENGINE=OLAP
DUPLICATE KEY(`id`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`id`) BUCKETS 10
PROPERTIES (
"replication_num" = "3",
"in_memory" = "false",
"storage_format" = "DEFAULT",
"enable_persistent_index" = "false"
);
  1. insert into test_array select 2, jsonObject -> '$.categoryMaterial' from test_json limit 1;
  2. select 2, jsonObject -> '$.categoryMaterial' from test_json limit 1; image

Expected behavior (Required)

Real behavior (Required)

image

StarRocks version (Required)

  • 2.3.0

zhuxt2015 avatar Aug 10 '22 06:08 zhuxt2015

Should be we don't support cast array json to array varchar.

kangkaisen avatar Aug 10 '22 07:08 kangkaisen