{
  "extensionUris": [{
    "extensionUriAnchor": 1,
    "uri": "/functions_boolean.yaml"
  }, {
    "extensionUriAnchor": 3,
    "uri": "/functions_arithmetic_decimal.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": 3,
      "functionAnchor": 2,
      "name": "multiply:dec_dec"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 3,
      "functionAnchor": 3,
      "name": "sum:dec"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 2,
      "functionAnchor": 4,
      "name": "gt:any_any"
    }
  }],
  "relations": [{
    "root": {
      "input": {
        "sort": {
          "common": {
            "direct": {
            }
          },
          "input": {
            "filter": {
              "common": {
                "direct": {
                }
              },
              "input": {
                "aggregate": {
                  "common": {
                    "direct": {
                    }
                  },
                  "input": {
                    "project": {
                      "common": {
                        "emit": {
                          "outputMapping": [16, 17]
                        }
                      },
                      "input": {
                        "filter": {
                          "common": {
                            "direct": {
                            }
                          },
                          "input": {
                            "cross": {
                              "common": {
                                "direct": {
                                }
                              },
                              "left": {
                                "cross": {
                                  "common": {
                                    "direct": {
                                    }
                                  },
                                  "left": {
                                    "read": {
                                      "common": {
                                        "direct": {
                                        }
                                      },
                                      "baseSchema": {
                                        "names": ["PS_PARTKEY", "PS_SUPPKEY", "PS_AVAILQTY", "PS_SUPPLYCOST", "PS_COMMENT"],
                                        "struct": {
                                          "types": [{
                                            "i64": {
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_REQUIRED"
                                            }
                                          }, {
                                            "i64": {
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_REQUIRED"
                                            }
                                          }, {
                                            "i32": {
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }, {
                                            "decimal": {
                                              "scale": 0,
                                              "precision": 19,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }, {
                                            "varchar": {
                                              "length": 199,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }],
                                          "typeVariationReference": 0,
                                          "nullability": "NULLABILITY_REQUIRED"
                                        }
                                      },
                                      "namedTable": {
                                        "names": ["PARTSUPP"]
                                      }
                                    }
                                  },
                                  "right": {
                                    "read": {
                                      "common": {
                                        "direct": {
                                        }
                                      },
                                      "baseSchema": {
                                        "names": ["S_SUPPKEY", "S_NAME", "S_ADDRESS", "S_NATIONKEY", "S_PHONE", "S_ACCTBAL", "S_COMMENT"],
                                        "struct": {
                                          "types": [{
                                            "i64": {
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_REQUIRED"
                                            }
                                          }, {
                                            "fixedChar": {
                                              "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"
                                            }
                                          }, {
                                            "varchar": {
                                              "length": 101,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          }],
                                          "typeVariationReference": 0,
                                          "nullability": "NULLABILITY_REQUIRED"
                                        }
                                      },
                                      "namedTable": {
                                        "names": ["SUPPLIER"]
                                      }
                                    }
                                  }
                                }
                              },
                              "right": {
                                "read": {
                                  "common": {
                                    "direct": {
                                    }
                                  },
                                  "baseSchema": {
                                    "names": ["N_NATIONKEY", "N_NAME", "N_REGIONKEY", "N_COMMENT"],
                                    "struct": {
                                      "types": [{
                                        "i64": {
                                          "typeVariationReference": 0,
                                          "nullability": "NULLABILITY_REQUIRED"
                                        }
                                      }, {
                                        "fixedChar": {
                                          "length": 25,
                                          "typeVariationReference": 0,
                                          "nullability": "NULLABILITY_NULLABLE"
                                        }
                                      }, {
                                        "i64": {
                                          "typeVariationReference": 0,
                                          "nullability": "NULLABILITY_REQUIRED"
                                        }
                                      }, {
                                        "varchar": {
                                          "length": 152,
                                          "typeVariationReference": 0,
                                          "nullability": "NULLABILITY_NULLABLE"
                                        }
                                      }],
                                      "typeVariationReference": 0,
                                      "nullability": "NULLABILITY_REQUIRED"
                                    }
                                  },
                                  "namedTable": {
                                    "names": ["NATION"]
                                  }
                                }
                              }
                            }
                          },
                          "condition": {
                            "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": 1
                                            }
                                          },
                                          "rootReference": {
                                          }
                                        }
                                      }
                                    }, {
                                      "value": {
                                        "selection": {
                                          "directReference": {
                                            "structField": {
                                              "field": 5
                                            }
                                          },
                                          "rootReference": {
                                          }
                                        }
                                      }
                                    }],
                                    "options": []
                                  }
                                }
                              }, {
                                "value": {
                                  "scalarFunction": {
                                    "functionReference": 1,
                                    "args": [],
                                    "outputType": {
                                      "bool": {
                                        "typeVariationReference": 0,
                                        "nullability": "NULLABILITY_REQUIRED"
                                      }
                                    },
                                    "arguments": [{
                                      "value": {
                                        "selection": {
                                          "directReference": {
                                            "structField": {
                                              "field": 8
                                            }
                                          },
                                          "rootReference": {
                                          }
                                        }
                                      }
                                    }, {
                                      "value": {
                                        "selection": {
                                          "directReference": {
                                            "structField": {
                                              "field": 12
                                            }
                                          },
                                          "rootReference": {
                                          }
                                        }
                                      }
                                    }],
                                    "options": []
                                  }
                                }
                              }, {
                                "value": {
                                  "scalarFunction": {
                                    "functionReference": 1,
                                    "args": [],
                                    "outputType": {
                                      "bool": {
                                        "typeVariationReference": 0,
                                        "nullability": "NULLABILITY_NULLABLE"
                                      }
                                    },
                                    "arguments": [{
                                      "value": {
                                        "selection": {
                                          "directReference": {
                                            "structField": {
                                              "field": 13
                                            }
                                          },
                                          "rootReference": {
                                          }
                                        }
                                      }
                                    }, {
                                      "value": {
                                        "cast": {
                                          "type": {
                                            "fixedChar": {
                                              "length": 25,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_REQUIRED"
                                            }
                                          },
                                          "input": {
                                            "literal": {
                                              "fixedChar": "JAPAN",
                                              "nullable": false,
                                              "typeVariationReference": 0
                                            }
                                          },
                                          "failureBehavior": "FAILURE_BEHAVIOR_UNSPECIFIED"
                                        }
                                      }
                                    }],
                                    "options": []
                                  }
                                }
                              }],
                              "options": []
                            }
                          }
                        }
                      },
                      "expressions": [{
                        "selection": {
                          "directReference": {
                            "structField": {
                              "field": 0
                            }
                          },
                          "rootReference": {
                          }
                        }
                      }, {
                        "scalarFunction": {
                          "functionReference": 2,
                          "args": [],
                          "outputType": {
                            "decimal": {
                              "scale": 0,
                              "precision": 19,
                              "typeVariationReference": 0,
                              "nullability": "NULLABILITY_NULLABLE"
                            }
                          },
                          "arguments": [{
                            "value": {
                              "selection": {
                                "directReference": {
                                  "structField": {
                                    "field": 3
                                  }
                                },
                                "rootReference": {
                                }
                              }
                            }
                          }, {
                            "value": {
                              "cast": {
                                "type": {
                                  "decimal": {
                                    "scale": 0,
                                    "precision": 19,
                                    "typeVariationReference": 0,
                                    "nullability": "NULLABILITY_NULLABLE"
                                  }
                                },
                                "input": {
                                  "selection": {
                                    "directReference": {
                                      "structField": {
                                        "field": 2
                                      }
                                    },
                                    "rootReference": {
                                    }
                                  }
                                },
                                "failureBehavior": "FAILURE_BEHAVIOR_UNSPECIFIED"
                              }
                            }
                          }],
                          "options": []
                        }
                      }]
                    }
                  },
                  "groupings": [{
                    "groupingExpressions": [{
                      "selection": {
                        "directReference": {
                          "structField": {
                            "field": 0
                          }
                        },
                        "rootReference": {
                        }
                      }
                    }]
                  }],
                  "measures": [{
                    "measure": {
                      "functionReference": 3,
                      "args": [],
                      "sorts": [],
                      "phase": "AGGREGATION_PHASE_INITIAL_TO_RESULT",
                      "outputType": {
                        "decimal": {
                          "scale": 0,
                          "precision": 19,
                          "typeVariationReference": 0,
                          "nullability": "NULLABILITY_NULLABLE"
                        }
                      },
                      "invocation": "AGGREGATION_INVOCATION_ALL",
                      "arguments": [{
                        "value": {
                          "selection": {
                            "directReference": {
                              "structField": {
                                "field": 1
                              }
                            },
                            "rootReference": {
                            }
                          }
                        }
                      }],
                      "options": []
                    }
                  }]
                }
              },
              "condition": {
                "scalarFunction": {
                  "functionReference": 4,
                  "args": [],
                  "outputType": {
                    "bool": {
                      "typeVariationReference": 0,
                      "nullability": "NULLABILITY_NULLABLE"
                    }
                  },
                  "arguments": [{
                    "value": {
                      "selection": {
                        "directReference": {
                          "structField": {
                            "field": 1
                          }
                        },
                        "rootReference": {
                        }
                      }
                    }
                  }, {
                    "value": {
                      "subquery": {
                        "scalar": {
                          "input": {
                            "project": {
                              "common": {
                                "emit": {
                                  "outputMapping": [1]
                                }
                              },
                              "input": {
                                "aggregate": {
                                  "common": {
                                    "direct": {
                                    }
                                  },
                                  "input": {
                                    "project": {
                                      "common": {
                                        "emit": {
                                          "outputMapping": [16]
                                        }
                                      },
                                      "input": {
                                        "filter": {
                                          "common": {
                                            "direct": {
                                            }
                                          },
                                          "input": {
                                            "cross": {
                                              "common": {
                                                "direct": {
                                                }
                                              },
                                              "left": {
                                                "cross": {
                                                  "common": {
                                                    "direct": {
                                                    }
                                                  },
                                                  "left": {
                                                    "read": {
                                                      "common": {
                                                        "direct": {
                                                        }
                                                      },
                                                      "baseSchema": {
                                                        "names": ["PS_PARTKEY", "PS_SUPPKEY", "PS_AVAILQTY", "PS_SUPPLYCOST", "PS_COMMENT"],
                                                        "struct": {
                                                          "types": [{
                                                            "i64": {
                                                              "typeVariationReference": 0,
                                                              "nullability": "NULLABILITY_REQUIRED"
                                                            }
                                                          }, {
                                                            "i64": {
                                                              "typeVariationReference": 0,
                                                              "nullability": "NULLABILITY_REQUIRED"
                                                            }
                                                          }, {
                                                            "i32": {
                                                              "typeVariationReference": 0,
                                                              "nullability": "NULLABILITY_NULLABLE"
                                                            }
                                                          }, {
                                                            "decimal": {
                                                              "scale": 0,
                                                              "precision": 19,
                                                              "typeVariationReference": 0,
                                                              "nullability": "NULLABILITY_NULLABLE"
                                                            }
                                                          }, {
                                                            "varchar": {
                                                              "length": 199,
                                                              "typeVariationReference": 0,
                                                              "nullability": "NULLABILITY_NULLABLE"
                                                            }
                                                          }],
                                                          "typeVariationReference": 0,
                                                          "nullability": "NULLABILITY_REQUIRED"
                                                        }
                                                      },
                                                      "namedTable": {
                                                        "names": ["PARTSUPP"]
                                                      }
                                                    }
                                                  },
                                                  "right": {
                                                    "read": {
                                                      "common": {
                                                        "direct": {
                                                        }
                                                      },
                                                      "baseSchema": {
                                                        "names": ["S_SUPPKEY", "S_NAME", "S_ADDRESS", "S_NATIONKEY", "S_PHONE", "S_ACCTBAL", "S_COMMENT"],
                                                        "struct": {
                                                          "types": [{
                                                            "i64": {
                                                              "typeVariationReference": 0,
                                                              "nullability": "NULLABILITY_REQUIRED"
                                                            }
                                                          }, {
                                                            "fixedChar": {
                                                              "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"
                                                            }
                                                          }, {
                                                            "varchar": {
                                                              "length": 101,
                                                              "typeVariationReference": 0,
                                                              "nullability": "NULLABILITY_NULLABLE"
                                                            }
                                                          }],
                                                          "typeVariationReference": 0,
                                                          "nullability": "NULLABILITY_REQUIRED"
                                                        }
                                                      },
                                                      "namedTable": {
                                                        "names": ["SUPPLIER"]
                                                      }
                                                    }
                                                  }
                                                }
                                              },
                                              "right": {
                                                "read": {
                                                  "common": {
                                                    "direct": {
                                                    }
                                                  },
                                                  "baseSchema": {
                                                    "names": ["N_NATIONKEY", "N_NAME", "N_REGIONKEY", "N_COMMENT"],
                                                    "struct": {
                                                      "types": [{
                                                        "i64": {
                                                          "typeVariationReference": 0,
                                                          "nullability": "NULLABILITY_REQUIRED"
                                                        }
                                                      }, {
                                                        "fixedChar": {
                                                          "length": 25,
                                                          "typeVariationReference": 0,
                                                          "nullability": "NULLABILITY_NULLABLE"
                                                        }
                                                      }, {
                                                        "i64": {
                                                          "typeVariationReference": 0,
                                                          "nullability": "NULLABILITY_REQUIRED"
                                                        }
                                                      }, {
                                                        "varchar": {
                                                          "length": 152,
                                                          "typeVariationReference": 0,
                                                          "nullability": "NULLABILITY_NULLABLE"
                                                        }
                                                      }],
                                                      "typeVariationReference": 0,
                                                      "nullability": "NULLABILITY_REQUIRED"
                                                    }
                                                  },
                                                  "namedTable": {
                                                    "names": ["NATION"]
                                                  }
                                                }
                                              }
                                            }
                                          },
                                          "condition": {
                                            "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": 1
                                                            }
                                                          },
                                                          "rootReference": {
                                                          }
                                                        }
                                                      }
                                                    }, {
                                                      "value": {
                                                        "selection": {
                                                          "directReference": {
                                                            "structField": {
                                                              "field": 5
                                                            }
                                                          },
                                                          "rootReference": {
                                                          }
                                                        }
                                                      }
                                                    }],
                                                    "options": []
                                                  }
                                                }
                                              }, {
                                                "value": {
                                                  "scalarFunction": {
                                                    "functionReference": 1,
                                                    "args": [],
                                                    "outputType": {
                                                      "bool": {
                                                        "typeVariationReference": 0,
                                                        "nullability": "NULLABILITY_REQUIRED"
                                                      }
                                                    },
                                                    "arguments": [{
                                                      "value": {
                                                        "selection": {
                                                          "directReference": {
                                                            "structField": {
                                                              "field": 8
                                                            }
                                                          },
                                                          "rootReference": {
                                                          }
                                                        }
                                                      }
                                                    }, {
                                                      "value": {
                                                        "selection": {
                                                          "directReference": {
                                                            "structField": {
                                                              "field": 12
                                                            }
                                                          },
                                                          "rootReference": {
                                                          }
                                                        }
                                                      }
                                                    }],
                                                    "options": []
                                                  }
                                                }
                                              }, {
                                                "value": {
                                                  "scalarFunction": {
                                                    "functionReference": 1,
                                                    "args": [],
                                                    "outputType": {
                                                      "bool": {
                                                        "typeVariationReference": 0,
                                                        "nullability": "NULLABILITY_NULLABLE"
                                                      }
                                                    },
                                                    "arguments": [{
                                                      "value": {
                                                        "selection": {
                                                          "directReference": {
                                                            "structField": {
                                                              "field": 13
                                                            }
                                                          },
                                                          "rootReference": {
                                                          }
                                                        }
                                                      }
                                                    }, {
                                                      "value": {
                                                        "cast": {
                                                          "type": {
                                                            "fixedChar": {
                                                              "length": 25,
                                                              "typeVariationReference": 0,
                                                              "nullability": "NULLABILITY_REQUIRED"
                                                            }
                                                          },
                                                          "input": {
                                                            "literal": {
                                                              "fixedChar": "JAPAN",
                                                              "nullable": false,
                                                              "typeVariationReference": 0
                                                            }
                                                          },
                                                          "failureBehavior": "FAILURE_BEHAVIOR_UNSPECIFIED"
                                                        }
                                                      }
                                                    }],
                                                    "options": []
                                                  }
                                                }
                                              }],
                                              "options": []
                                            }
                                          }
                                        }
                                      },
                                      "expressions": [{
                                        "scalarFunction": {
                                          "functionReference": 2,
                                          "args": [],
                                          "outputType": {
                                            "decimal": {
                                              "scale": 0,
                                              "precision": 19,
                                              "typeVariationReference": 0,
                                              "nullability": "NULLABILITY_NULLABLE"
                                            }
                                          },
                                          "arguments": [{
                                            "value": {
                                              "selection": {
                                                "directReference": {
                                                  "structField": {
                                                    "field": 3
                                                  }
                                                },
                                                "rootReference": {
                                                }
                                              }
                                            }
                                          }, {
                                            "value": {
                                              "cast": {
                                                "type": {
                                                  "decimal": {
                                                    "scale": 0,
                                                    "precision": 19,
                                                    "typeVariationReference": 0,
                                                    "nullability": "NULLABILITY_NULLABLE"
                                                  }
                                                },
                                                "input": {
                                                  "selection": {
                                                    "directReference": {
                                                      "structField": {
                                                        "field": 2
                                                      }
                                                    },
                                                    "rootReference": {
                                                    }
                                                  }
                                                },
                                                "failureBehavior": "FAILURE_BEHAVIOR_UNSPECIFIED"
                                              }
                                            }
                                          }],
                                          "options": []
                                        }
                                      }]
                                    }
                                  },
                                  "groupings": [{
                                    "groupingExpressions": []
                                  }],
                                  "measures": [{
                                    "measure": {
                                      "functionReference": 3,
                                      "args": [],
                                      "sorts": [],
                                      "phase": "AGGREGATION_PHASE_INITIAL_TO_RESULT",
                                      "outputType": {
                                        "decimal": {
                                          "scale": 0,
                                          "precision": 19,
                                          "typeVariationReference": 0,
                                          "nullability": "NULLABILITY_NULLABLE"
                                        }
                                      },
                                      "invocation": "AGGREGATION_INVOCATION_ALL",
                                      "arguments": [{
                                        "value": {
                                          "selection": {
                                            "directReference": {
                                              "structField": {
                                                "field": 0
                                              }
                                            },
                                            "rootReference": {
                                            }
                                          }
                                        }
                                      }],
                                      "options": []
                                    }
                                  }]
                                }
                              },
                              "expressions": [{
                                "scalarFunction": {
                                  "functionReference": 2,
                                  "args": [],
                                  "outputType": {
                                    "decimal": {
                                      "scale": 10,
                                      "precision": 19,
                                      "typeVariationReference": 0,
                                      "nullability": "NULLABILITY_NULLABLE"
                                    }
                                  },
                                  "arguments": [{
                                    "value": {
                                      "selection": {
                                        "directReference": {
                                          "structField": {
                                            "field": 0
                                          }
                                        },
                                        "rootReference": {
                                        }
                                      }
                                    }
                                  }, {
                                    "value": {
                                      "literal": {
                                        "decimal": {
                                          "value": "QEIPAAAAAAAAAAAAAAAAAA==",
                                          "precision": 11,
                                          "scale": 10
                                        },
                                        "nullable": false,
                                        "typeVariationReference": 0
                                      }
                                    }
                                  }],
                                  "options": []
                                }
                              }]
                            }
                          }
                        }
                      }
                    }
                  }],
                  "options": []
                }
              }
            }
          },
          "sorts": [{
            "expr": {
              "selection": {
                "directReference": {
                  "structField": {
                    "field": 1
                  }
                },
                "rootReference": {
                }
              }
            },
            "direction": "SORT_DIRECTION_DESC_NULLS_FIRST"
          }]
        }
      },
      "names": ["PS_PARTKEY", "value"]
    }
  }],
  "expectedTypeUrls": []
}
