How does elasticsearch's bucket_script use the higher-level bucket_path,? is there any other solution if it can't be used?

for example, my request json is as follows:

{
  "size": 0, 
  "aggs": {
    "car_type": {
      "terms": {
        "field": "screenName",
        "size": 10
      },
      "aggs": {
        "active_num": {
          "terms": {
            "field": "activeNum",
            "size": 10
          },
          "aggs": {
            "active_count": {
              "value_count": {
                "field": "activeNum"
              }
            }
          }
        },
        "all_count": {
          "value_count": {
            "field": "activeNum"
          }
        },
        "result" : {
          "bucket_script": {
             "buckets_path": {
                "count1" : "all_count",
                "count2" : "active_num>active_count"
              },
              "script": "params.count2/params.count1"
          }
        }
      }
    }
  }
}

in this case, there will be another error, because there will be multiple values for active_count . The error is as follows:

buckets_path must reference either a number value or a single value numeric metric aggregation, got: java.lang.Object []

how can I achieve my goal?

Dec.04,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-7c2d28-2aa10.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-7c2d28-2aa10.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?