linrrzqqq opened a new pull request, #67673:
URL: https://github.com/apache/doris/pull/67673

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary:
   
   Support two embed resource session var: `default_embed_resource` and 
`default_multimodal_embed_resource`
   
   ```text
   Doris> set default_embed_resource='qwen-embed'
       -> ;
   Query OK, 0 rows affected (0.006 sec)
   
   Doris> set default_multimodal_embed_resource='qwen_mul_embed';
   Query OK, 0 rows affected (0.002 sec)
   
   Doris> show variables like '%default%resource%';
   
+----------------------------------+-----------------------+---------------+---------+
   | Variable_name                    | Value                 | Default_Value | 
Changed |
   
+----------------------------------+-----------------------+---------------+---------+
   | default_ai_resource              | fake-multimodal-embed |               | 
1       |
   | default_embed_resource           | qwen-embed            |               | 
1       |
   | default_multimode_embed_resource | qwen_mul_embed        |               | 
1       |
   
+----------------------------------+-----------------------+---------------+---------+
   
   Doris> EXPLAIN SELECT array_size(EMBED('this is a test'));
   +-------------------------------------------------------------+
   | Explain String(Nereids Planner)                             |
   +-------------------------------------------------------------+
   | PLAN FRAGMENT 0                                             |
   |   OUTPUT EXPRS:                                             |
   |     array_size(EMBED('this is a test'))[#0]                 |
   |   PARTITION: UNPARTITIONED                                  |
   |                                                             |
   |   HAS_COLO_PLAN_NODE: false                                 |
   |                                                             |
   |   VRESULT SINK                                              |
   |      MYSQL_PROTOCOL                                         |
   |                                                             |
   |   0:VUNION(11)                                              |
   |      constant exprs:                                        |
   |          cardinality(embed('qwen-embed', 'this is a test')) |
   |                                                             |
   |                                                             |
   |                                                             |
   | ========== STATISTICS ==========                            |
   +-------------------------------------------------------------+
   
   Doris> set default_multimodal_embed_resource='qwen_mul_embed';
   Query OK, 0 rows affected (0.002 sec)
   
   Doris> EXPLAIN SELECT ARRAY_SIZE(
       ->     EMBED(
       ->         CAST('{
       '>             "uri": "s3://xxx",
       '>             "content_type": "image/png",
       '>             "endpoint": "cos.ap-hongkong.myqcloud.com",
       '>             "region": "ap-hongkong",
       '>             "ak": "xxxi",
       '>             "sk": "xxx"
       '>         }' AS JSON)
       ->     )
       -> ) AS img_embed_size_ak_sk;
   
+---------------------------------------------------------------------------------+
   | Explain String(Nereids Planner)                                            
     |
   
+---------------------------------------------------------------------------------+
   | PLAN FRAGMENT 0                                                            
     |
   |   OUTPUT EXPRS:                                                            
     |
   |     img_embed_size_ak_sk[#0]                                               
     |
   |   PARTITION: UNPARTITIONED                                                 
     |
   |                                                                            
     |
   |   HAS_COLO_PLAN_NODE: false                                                
     |
   |                                                                            
     |
   |   VRESULT SINK                                                             
     |
   |      MYSQL_PROTOCOL                                                        
     |
   |                                                                            
     |
   |   0:VUNION(11)                                                             
     |
   |      constant exprs:                                                       
     |
   |          cardinality(embed('qwen_mul_embed', CAST('{                       
     |
   |             "uri": "s3://xxx", |
   |             "content_type": "image/png",                                   
     |
   |             "endpoint": "cos.ap-hongkong.myqcloud.com",                    
     |
   |             "region": "ap-hongkong",                                       
     |
   |             "ak": "xxx",                       |
   |             "sk": "xxx"                            |
   |         }' AS json)))                                                      
     |
   |                                                                            
     |
   |                                                                            
     |
   |                                                                            
     |
   | ========== STATISTICS ==========                                           
     |
   
+---------------------------------------------------------------------------------+
   24 rows in set (0.020 sec)
   ```
   
   ### Release note
   
   None


-- 
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.

To unsubscribe, e-mail: [email protected]

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