{
  "extensionUris": [{
    "extensionUriAnchor": 4,
    "uri": "/functions_aggregate_generic.yaml"
  }, {
    "extensionUriAnchor": 1,
    "uri": "/functions_boolean.yaml"
  }, {
    "extensionUriAnchor": 3,
    "uri": "/functions_string.yaml"
  }, {
    "extensionUriAnchor": 2,
    "uri": "/functions_comparison.yaml"
  }],
  "extensions": [{
    "extensionFunction": {
      "extensionUriReference": 1,
      "functionAnchor": 0,
      "name": "and:bool"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 2,
      "functionAnchor": 1,
      "name": "equal:any_any"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 1,
      "functionAnchor": 2,
      "name": "not:bool"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 3,
      "functionAnchor": 3,
      "name": "like:vchar_vchar"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 4,
      "functionAnchor": 4,
      "name": "count:any"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 4,
      "functionAnchor": 5,
      "name": "count:any"
    }
  }],
  "relations": [{
    "root": {
      "input": {
        "sort": {
          "common": {
            "direct": {
            }
          },
          "input": {
            "project": {
              "common": {
                "emit": {
                  "outputMapping": [2, 3]
                }
              },
              "input": {
                "aggregate": {
                  "common": {
                    "direct": {
                    }
                  },
                  "input": {
                    "project": {
                      "common": {
                        "emit": {
                          "outputMapping": [2]
                        }
                      },
                      "input": {
                        "aggregate": {
                          "common": {
                            "direct": {
                            }
                          },
                          "input": {
                            "project": {
                              "common": {
                                "emit": {
                                  "outputMapping": [17, 18]
                                }
                              },
                              "input": {
                                "join": {
                                  "common": {
                                    "direct": {
                                    }
                                  },
                                  "left": {
                                    "read": {
                                      "common": {
                                        "direct": {
                                        }
                                      },
                                      "baseSchema": {
                                        "names": ["C_CUSTKEY", "C_NAME", "C_ADDRESS", "C_NATIONKEY", "C_PHONE", "C_ACCTBAL", "C_MKTSEGMENT", "C_COMMENT"],
                                        "struct": {
                                          "types": [{
                                            "i64": {
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_REQUIRED"
                                            }
                                          }, {
                                            "varchar": {
                                              "length": 25,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }, {
                                            "varchar": {
                                              "length": 40,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }, {
                                            "i64": {
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_REQUIRED"
                                            }
                                          }, {
                                            "fixedChar": {
                                              "length": 15,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }, {
                                            "decimal": {
                                              "scale": 0,
                                              "precision": 19,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }, {
                                            "fixedChar": {
                                              "length": 10,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }, {
                                            "varchar": {
                                              "length": 117,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }],
                                          "typeVariationReference": 0,
                                          "nullability": "NULLABILITY_REQUIRED"
                                        }
                                      },
                                      "namedTable": {
                                        "names": ["CUSTOMER"]
                                      }
                                    }
                                  },
                                  "right": {
                                    "read": {
                                      "common": {
                                        "direct": {
                                        }
                                      },
                                      "baseSchema": {
                                        "names": ["O_ORDERKEY", "O_CUSTKEY", "O_ORDERSTATUS", "O_TOTALPRICE", "O_ORDERDATE", "O_ORDERPRIORITY", "O_CLERK", "O_SHIPPRIORITY", "O_COMMENT"],
                                        "struct": {
                                          "types": [{
                                            "i64": {
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_REQUIRED"
                                            }
                                          }, {
                                            "i64": {
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_REQUIRED"
                                            }
                                          }, {
                                            "fixedChar": {
                                              "length": 1,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }, {
                                            "decimal": {
                                              "scale": 0,
                                              "precision": 19,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }, {
                                            "date": {
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }, {
                                            "fixedChar": {
                                              "length": 15,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }, {
                                            "fixedChar": {
                                              "length": 15,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }, {
                                            "i32": {
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }, {
                                            "varchar": {
                                              "length": 79,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }],
                                          "typeVariationReference": 0,
                                          "nullability": "NULLABILITY_REQUIRED"
                                        }
                                      },
                                      "namedTable": {
                                        "names": ["ORDERS"]
                                      }
                                    }
                                  },
                                  "expression": {
                                    "scalarFunction": {
                                      "functionReference": 0,
                                      "args": [],
                                      "outputType": {
                                        "bool": {
                                          "typeVariationReference": 0,
                                          "nullability": "NULLABILITY_NULLABLE"
                                        }
                                      },
                                      "arguments": [{
                                        "value": {
                                          "scalarFunction": {
                                            "functionReference": 1,
                                            "args": [],
                                            "outputType": {
                                              "bool": {
                                                "typeVariationReference": 0,
                                                "nullability": "NULLABILITY_REQUIRED"
                                              }
                                            },
                                            "arguments": [{
                                              "value": {
                                                "selection": {
                                                  "directReference": {
                                                    "structField": {
                                                      "field": 0
                                                    }
                                                  },
                                                  "rootReference": {
                                                  }
                                                }
                                              }
                                            }, {
                                              "value": {
                                                "selection": {
                                                  "directReference": {
                                                    "structField": {
                                                      "field": 9
                                                    }
                                                  },
                                                  "rootReference": {
                                                  }
                                                }
                                              }
                                            }],
                                            "options": []
                                          }
                                        }
                                      }, {
                                        "value": {
                                          "scalarFunction": {
                                            "functionReference": 2,
                                            "args": [],
                                            "outputType": {
                                              "bool": {
                                                "typeVariationReference": 0,
                                                "nullability": "NULLABILITY_NULLABLE"
                                              }
                                            },
                                            "arguments": [{
                                              "value": {
                                                "scalarFunction": {
                                                  "functionReference": 3,
                                                  "args": [],
                                                  "outputType": {
                                                    "bool": {
                                                      "typeVariationReference": 0,
                                                      "nullability": "NULLABILITY_NULLABLE"
                                                    }
                                                  },
                                                  "arguments": [{
                                                    "value": {
                                                      "selection": {
                                                        "directReference": {
                                                          "structField": {
                                                            "field": 16
                                                          }
                                                        },
                                                        "rootReference": {
                                                        }
                                                      }
                                                    }
                                                  }, {
                                                    "value": {
                                                      "cast": {
                                                        "type": {
                                                          "varchar": {
                                                            "length": 79,
                                                            "typeVariationReference": 0,
                                                            "nullability": "NULLABILITY_NULLABLE"
                                                          }
                                                        },
                                                        "input": {
                                                          "literal": {
                                                            "fixedChar": "%special%requests%",
                                                            "nullable": false,
                                                            "typeVariationReference": 0
                                                          }
                                                        },
                                                        "failureBehavior": "FAILURE_BEHAVIOR_UNSPECIFIED"
                                                      }
                                                    }
                                                  }],
                                                  "options": []
                                                }
                                              }
                                            }],
                                            "options": []
                                          }
                                        }
                                      }],
                                      "options": []
                                    }
                                  },
                                  "type": "JOIN_TYPE_LEFT"
                                }
                              },
                              "expressions": [{
                                "selection": {
                                  "directReference": {
                                    "structField": {
                                      "field": 0
                                    }
                                  },
                                  "rootReference": {
                                  }
                                }
                              }, {
                                "selection": {
                                  "directReference": {
                                    "structField": {
                                      "field": 8
                                    }
                                  },
                                  "rootReference": {
                                  }
                                }
                              }]
                            }
                          },
                          "groupings": [{
                            "groupingExpressions": [{
                              "selection": {
                                "directReference": {
                                  "structField": {
                                    "field": 0
                                  }
                                },
                                "rootReference": {
                                }
                              }
                            }]
                          }],
                          "measures": [{
                            "measure": {
                              "functionReference": 4,
                              "args": [],
                              "sorts": [],
                              "phase": "AGGREGATION_PHASE_INITIAL_TO_RESULT",
                              "outputType": {
                                "i64": {
                                  "typeVariationReference": 0,
                                  "nullability": "NULLABILITY_REQUIRED"
                                }
                              },
                              "invocation": "AGGREGATION_INVOCATION_ALL",
                              "arguments": [{
                                "value": {
                                  "selection": {
                                    "directReference": {
                                      "structField": {
                                        "field": 1
                                      }
                                    },
                                    "rootReference": {
                                    }
                                  }
                                }
                              }],
                              "options": []
                            }
                          }]
                        }
                      },
                      "expressions": [{
                        "selection": {
                          "directReference": {
                            "structField": {
                              "field": 1
                            }
                          },
                          "rootReference": {
                          }
                        }
                      }]
                    }
                  },
                  "groupings": [{
                    "groupingExpressions": [{
                      "selection": {
                        "directReference": {
                          "structField": {
                            "field": 0
                          }
                        },
                        "rootReference": {
                        }
                      }
                    }]
                  }],
                  "measures": [{
                    "measure": {
                      "functionReference": 5,
                      "args": [],
                      "sorts": [],
                      "phase": "AGGREGATION_PHASE_INITIAL_TO_RESULT",
                      "outputType": {
                        "i64": {
                          "typeVariationReference": 0,
                          "nullability": "NULLABILITY_REQUIRED"
                        }
                      },
                      "invocation": "AGGREGATION_INVOCATION_ALL",
                      "arguments": [],
                      "options": []
                    }
                  }]
                }
              },
              "expressions": [{
                "selection": {
                  "directReference": {
                    "structField": {
                      "field": 0
                    }
                  },
                  "rootReference": {
                  }
                }
              }, {
                "selection": {
                  "directReference": {
                    "structField": {
                      "field": 1
                    }
                  },
                  "rootReference": {
                  }
                }
              }]
            }
          },
          "sorts": [{
            "expr": {
              "selection": {
                "directReference": {
                  "structField": {
                    "field": 1
                  }
                },
                "rootReference": {
                }
              }
            },
            "direction": "SORT_DIRECTION_DESC_NULLS_FIRST"
          }, {
            "expr": {
              "selection": {
                "directReference": {
                  "structField": {
                    "field": 0
                  }
                },
                "rootReference": {
                }
              }
            },
            "direction": "SORT_DIRECTION_DESC_NULLS_FIRST"
          }]
        }
      },
      "names": ["C_COUNT", "CUSTDIST"]
    }
  }],
  "expectedTypeUrls": []
}
