File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ func NewODPSClient(logger *slog.Logger, client *odps.Odps) *odpsClient {
2828// with capability to do graceful shutdown by terminating task instance
2929// when context is cancelled.
3030func (c * odpsClient ) ExecSQL (ctx context.Context , query string ) error {
31- taskIns , err := c .client .ExecSQl (query )
31+ hints := addHints (query )
32+ taskIns , err := c .client .ExecSQlWithHints (query , hints )
3233 if err != nil {
3334 return errors .WithStack (err )
3435 }
@@ -82,3 +83,14 @@ func wait(taskIns *odps.Instance) <-chan error {
8283 }(errChan )
8384 return errChan
8485}
86+
87+ func addHints (query string ) map [string ]string {
88+ multisql := strings .Contains (query , ";" )
89+ if multisql {
90+ return map [string ]string {
91+ "odps.sql.submit.mode" : "script" ,
92+ }
93+ }
94+
95+ return nil
96+ }
You can’t perform that action at this time.
0 commit comments