File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -52,15 +52,16 @@ func (c *Client) Close() error {
5252
5353func (c * Client ) ExecuteFn (id int ) func (context.Context , string , map [string ]string ) error {
5454 return func (ctx context.Context , query string , additionalHints map [string ]string ) error {
55- // execute query with odps client
5655 c .logger .Info (fmt .Sprintf ("[sequence: %d] query to execute:\n %s" , id , query ))
57- // Merge additionalHints with the id
58- if additionalHints == nil {
59- additionalHints = make (map [string ]string )
56+ // Create local copy of additionalHints with sequence hint
57+ hints := make (map [string ]string , len (additionalHints )+ 1 )
58+ for k , v := range additionalHints {
59+ hints [k ] = v
6060 }
61- additionalHints [SqlScriptSequenceHint ] = fmt .Sprintf ("%d" , id )
61+ hints [SqlScriptSequenceHint ] = fmt .Sprintf ("%d" , id )
6262
63- if err := c .OdpsClient .ExecSQL (ctx , query , additionalHints ); err != nil {
63+ // execute query with odps client
64+ if err := c .OdpsClient .ExecSQL (ctx , query , hints ); err != nil {
6465 return errors .WithStack (err )
6566 }
6667
You can’t perform that action at this time.
0 commit comments