@@ -6,6 +6,7 @@ package resources
66import (
77 "context"
88 "fmt"
9+ "slices"
910 "sync"
1011
1112 "github.com/aws/aws-sdk-go-v2/service/athena"
@@ -107,8 +108,8 @@ type mqlAwsAthenaWorkgroupInternal struct {
107108 cachedPublish bool
108109 cachedRequester bool
109110 cachedBytesCutoff int64
110- cachedEngineVer interface {}
111- cachedResultCfg interface {}
111+ cachedEngineVer any
112+ cachedResultCfg any
112113 lock sync.Mutex
113114}
114115
@@ -189,14 +190,14 @@ func (a *mqlAwsAthenaWorkgroup) requesterPaysEnabled() (bool, error) {
189190 return a .cachedRequester , nil
190191}
191192
192- func (a * mqlAwsAthenaWorkgroup ) engineVersion () (interface {} , error ) {
193+ func (a * mqlAwsAthenaWorkgroup ) engineVersion () (any , error ) {
193194 if err := a .fetchConfig (); err != nil {
194195 return nil , err
195196 }
196197 return a .cachedEngineVer , nil
197198}
198199
199- func (a * mqlAwsAthenaWorkgroup ) resultConfiguration () (interface {} , error ) {
200+ func (a * mqlAwsAthenaWorkgroup ) resultConfiguration () (any , error ) {
200201 if err := a .fetchConfig (); err != nil {
201202 return nil , err
202203 }
@@ -282,7 +283,7 @@ func newMqlAwsAthenaDataCatalog(runtime *plugin.Runtime, region string, catalog
282283type mqlAwsAthenaDataCatalogInternal struct {
283284 fetchedDetail bool
284285 cachedDesc string
285- cachedParams map [string ]interface {}
286+ cachedParams map [string ]any
286287 lock sync.Mutex
287288}
288289
@@ -309,7 +310,7 @@ func (a *mqlAwsAthenaDataCatalog) fetchDetail() error {
309310 if resp .DataCatalog != nil {
310311 a .cachedDesc = convert .ToValue (resp .DataCatalog .Description )
311312 if resp .DataCatalog .Parameters != nil {
312- params := make (map [string ]interface {} , len (resp .DataCatalog .Parameters ))
313+ params := make (map [string ]any , len (resp .DataCatalog .Parameters ))
313314 for k , v := range resp .DataCatalog .Parameters {
314315 params [k ] = v
315316 }
@@ -327,7 +328,7 @@ func (a *mqlAwsAthenaDataCatalog) description() (string, error) {
327328 return a .cachedDesc , nil
328329}
329330
330- func (a * mqlAwsAthenaDataCatalog ) parameters () (map [string ]interface {} , error ) {
331+ func (a * mqlAwsAthenaDataCatalog ) parameters () (map [string ]any , error ) {
331332 if err := a .fetchDetail (); err != nil {
332333 return nil , err
333334 }
@@ -382,13 +383,9 @@ func (a *mqlAwsAthena) getNamedQueries(conn *connection.AwsConnection) []*jobpoo
382383 }
383384
384385 // Batch get named queries (max 50 per call)
385- for i := 0 ; i < len (queryIds ); i += 50 {
386- end := i + 50
387- if end > len (queryIds ) {
388- end = len (queryIds )
389- }
386+ for chunk := range slices .Chunk (queryIds , 50 ) {
390387 batch , err := svc .BatchGetNamedQuery (ctx , & athena.BatchGetNamedQueryInput {
391- NamedQueryIds : queryIds [ i : end ] ,
388+ NamedQueryIds : chunk ,
392389 })
393390 if err != nil {
394391 return nil , err
@@ -428,7 +425,7 @@ func newMqlAwsAthenaNamedQuery(runtime *plugin.Runtime, region string, nq athena
428425 return resource .(* mqlAwsAthenaNamedQuery ), nil
429426}
430427
431- func (a * mqlAwsAthenaWorkgroup ) tags () (map [string ]interface {} , error ) {
428+ func (a * mqlAwsAthenaWorkgroup ) tags () (map [string ]any , error ) {
432429 if a .Arn .Error != nil {
433430 return nil , a .Arn .Error
434431 }
@@ -442,7 +439,7 @@ func (a *mqlAwsAthenaWorkgroup) tags() (map[string]interface{}, error) {
442439 svc := conn .Athena (region )
443440 ctx := context .Background ()
444441
445- tags := make (map [string ]interface {} )
442+ tags := make (map [string ]any )
446443 var nextToken * string
447444 for {
448445 resp , err := svc .ListTagsForResource (ctx , & athena.ListTagsForResourceInput {
0 commit comments