github-actions[bot] commented on issue #9596:
URL: 
https://github.com/apache/dolphinscheduler/issues/9596#issuecomment-1102720476

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   When I execute a SQL task, I get an error `execute sql error: Can not issue 
data manipulation statements with executeQuery()`
   
   The database uses Doris
   
   Both table creation and select can be executed normally
   
   ### What you expected to happen
   
   Ability to execute insert statements
   
   ### How to reproduce
   
   target table
   ````
   CREATE TABLE `wx_payment_details` (
     `create_time` datetime NOT NULL COMMENT "create time",
     `amount` decimal(12, 4) NULL COMMENT "Payment Amount",
     `settlement_refund_fee` decimal(12, 4) NULL COMMENT "Refund Amount",
     `goods_name` varchar(100) NULL COMMENT "goods name",
     `goods_type` varchar(50) NULL COMMENT "goods type",
     `transaction_id` varchar(100) NOT NULL DEFAULT "reserve" COMMENT "WeChat 
order number"
   ) ENGINE=OLAP
   DUPLICATE KEY(`create_time`)
   COMMENT "WeChat order record"
   DISTRIBUTED BY HASH(`create_time`) BUCKETS 10
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "in_memory" = "false",
   "storage_format" = "V2"
   );
   ````
   source table
   CREATE TABLE `wx_payment_details_load` (
     `create_time` varchar(100) NOT NULL COMMENT "",
     `appid` varchar(100) NOT NULL COMMENT "",
     `mch_id` varchar(100) NOT NULL COMMENT "",
     `mch_id_child` varchar(50) NOT NULL COMMENT "",
     `device_info` varchar(60) NULL COMMENT "",
     `transaction_id` varchar(100) NOT NULL COMMENT "",
     `out_trade_no` varchar(100) NOT NULL COMMENT "",
     `openid` varchar(100) NOT NULL COMMENT "",
     `trade_type` varchar(100) NOT NULL COMMENT "",
     `trade_state` varchar(100) NOT NULL COMMENT "",
     `bank_type` varchar(100) NOT NULL COMMENT "",
     `fee_type` varchar(100) NOT NULL COMMENT "",
     `amount` varchar(50) NOT NULL COMMENT "",
     `enterprise_discounts` varchar(100) NOT NULL COMMENT "",
     `refund_id` varchar(100) NOT NULL COMMENT "",
     `out_refund_no` varchar(100) NOT NULL COMMENT "",
     `settlement_refund_fee` varchar(50) NOT NULL COMMENT "",
     `enterprise_refund_discounts` varchar(100) NOT NULL COMMENT "",
     `refund_type` varchar(100) NULL COMMENT "",
     `refund_status` varchar(100) NULL COMMENT "",
     `goods_name` varchar(100) NOT NULL COMMENT "",
     `attach` varchar(100) NOT NULL COMMENT "",
     `service_charge` varchar(100) NOT NULL COMMENT "",
     `rate` varchar(100) NOT NULL COMMENT ""
   ) ENGINE=OLAP
   DUPLICATE KEY(`create_time`)
   COMMENT "OLAP"
   DISTRIBUTED BY HASH(`create_time`) BUCKETS 10
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "in_memory" = "false",
   "storage_format" = "V2"
   );
   
   Write the WeChat bill in the source table into the target table after 
processing
   ````
   INSERT into example_db.wx_payment_details SELECT
     CAST ( split_part(create_time, '`', 2) as datetime ) as create_time,
     0 + split_part(amount, '`', 2) as amount,
     0 - split_part(settlement_refund_fee, '`', 2) as settlement_refund_fee ,
     split_part(goods_name, '`', 2) as goods_name,
     CASE goods_name
     when '`outpatient' then 'outpatient payment'
     when '`payment between clinics' then 'payment for outpatient clinics'
     when '`hospitalization payment' then 'hospitalization payment'
     when '`hospitalization prepayment' then 'hospitalization payment'
     else goods_name end as goods_type,
     split_part(transaction_id, '`', 2) as transaction_id
   FROM fy_payment_db.wx_payment_details_load;
   ````
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   2.0.2
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)


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

Reply via email to