zh0122 commented on issue #3509:
URL: 
https://github.com/apache/incubator-doris/issues/3509#issuecomment-727248953


   > 最新相关接口:
   > 参数strip_outer_array: 表示是否展平数组
   > 参数jsonpaths:json字符串且以数组对象开始,里面包含各个列对应的jsonpath
   > 参数format:csv、json两种取值
   > 
   > 例如:
   > CREATE ROUTINE LOAD example_db.test_json_label_1 ON table1
   > COLUMNS(category, price, author)
   > PROPERTIES
   > (
   > "desired_concurrent_number"="3",
   > "max_batch_interval" = "20",
   > "max_batch_rows" = "300000",
   > "max_batch_size" = "209715200",
   > "strict_mode" = "false",
   > "format" = "json",
   > "strip_outer_array" = "true",
   > "jsonpaths" = "["$.category","$.price","$.author"]"
   > )
   > FROM KAFKA
   > (
   > "kafka_broker_list" = "broker1:9092,broker2:9092,broker3:9092",
   > "kafka_topic" = "my_topic",
   > "kafka_partitions" = "0,1,2",
   > "kafka_offsets" = "0,0,0"
   > );
   
   https://github.com/apache/incubator-doris/issues/3124
   
   > I has completed this function.
   > PR: `https://github.com/apache/incubator-doris/pull/3230`
   > 
   > For example:
   > 
   > ```
   > CREATE TABLE `test_json_price`(
   >   `category` varchar(32),
   >   `author` varchar(32),
   >   `title` varchar(32),
   >   `price` double  SUM
   > 
   > ) ENGINE=OLAP
   > AGGREGATE KEY(category, author, title)
   > DISTRIBUTED BY HASH(category, author, title) BUCKETS 32
   > PROPERTIES ("storage_type"="column","replication_num" = "1");
   > 
   > 
   > CREATE ROUTINE LOAD mediavad.test_json_price_label001 ON test_json_price
   > COLUMNS(category, author, title, price)
   > PROPERTIES
   > (
   >     "desired_concurrent_number"="3",
   >     "max_batch_interval" = "20",
   >     "max_batch_rows" = "300000",
   >     "max_batch_size" = "209715200",
   >     "strict_mode" = "false",
   >     "format" = "json",
   >     "jsonpath" = 
"{\"jsonpath\":[{\"column\":\"category\",\"value\":\"$.store.book.category\"},{\"column\":\"author\",\"value\":\"$.store.book.author\"},{\"column\":\"title\",\"value\":\"$.store.book.title\"},{\"column\":\"price\",\"value\":\"$.store.book.price\"}]}"
   > )
   > FROM KAFKA
   > (
   >     "kafka_broker_list" = 
"192.168.125.110:9092,192.168.125.120:9092,192.168.125.130:9092",
   >     "kafka_topic" = "KafkaLoadJsonForDoris",
   >     "kafka_partitions" = "0,1,2",
   >     "kafka_offsets" = "0,0,0"
   > );
   > ```
   
   Hi worker24h, 
   
   请问在0.13版中, jsonpath 的格式如何定义,  在Routine load 中, 如果json中字段和表中的字段名不一致, 
请问如何指定导入规则? 
   
   谢谢
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to