{
  "extensionUris": [{
    "extensionUriAnchor": 3,
    "uri": "/functions_aggregate_generic.yaml"
  }, {
    "extensionUriAnchor": 2,
    "uri": "/functions_arithmetic_decimal.yaml"
  }, {
    "extensionUriAnchor": 1,
    "uri": "/functions_datetime.yaml"
  }],
  "extensions": [{
    "extensionFunction": {
      "extensionUriReference": 1,
      "functionAnchor": 0,
      "name": "lte:date_date"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 1,
      "functionAnchor": 1,
      "name": "subtract:date_day"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 2,
      "functionAnchor": 2,
      "name": "multiply:dec_dec"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 2,
      "functionAnchor": 3,
      "name": "subtract:dec_dec"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 2,
      "functionAnchor": 4,
      "name": "add:dec_dec"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 2,
      "functionAnchor": 5,
      "name": "sum:dec"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 2,
      "functionAnchor": 6,
      "name": "avg:dec"
    }
  }, {
    "extensionFunction": {
      "extensionUriReference": 3,
      "functionAnchor": 7,
      "name": "count:any"
    }
  }],
  "relations": [{
    "root": {
      "input": {
        "sort": {
          "common": {
            "direct": {
            }
          },
          "input": {
            "aggregate": {
              "common": {
                "direct": {
                }
              },
              "input": {
                "project": {
                  "common": {
                    "emit": {
                      "outputMapping": [16, 17, 18, 19, 20, 21, 22]
                    }
                  },
                  "input": {
                    "filter": {
                      "common": {
                        "direct": {
                        }
                      },
                      "input": {
                        "read": {
                          "common": {
                            "direct": {
                            }
                          },
                          "baseSchema": {
                            "names": ["L_ORDERKEY", "L_PARTKEY", "L_SUPPKEY", "L_LINENUMBER", "L_QUANTITY", "L_EXTENDEDPRICE", "L_DISCOUNT", "L_TAX", "L_RETURNFLAG", "L_LINESTATUS", "L_SHIPDATE", "L_COMMITDATE", "L_RECEIPTDATE", "L_SHIPINSTRUCT", "L_SHIPMODE", "L_COMMENT"],
                            "struct": {
                              "types": [{
                                "i64": {
                                  "typeVariationReference": 0,
                                  "nullability": "NULLABILITY_REQUIRED"
                                }
                              }, {
                                "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"
                                }
                              }, {
                                "decimal": {
                                  "scale": 0,
                                  "precision": 19,
                                  "typeVariationReference": 0,
                                  "nullability": "NULLABILITY_NULLABLE"
                                }
                              }, {
                                "decimal": {
                                  "scale": 0,
                                  "precision": 19,
                                  "typeVariationReference": 0,
                                  "nullability": "NULLABILITY_NULLABLE"
                                }
                              }, {
                                "decimal": {
                                  "scale": 0,
                                  "precision": 19,
                                  "typeVariationReference": 0,
                                  "nullability": "NULLABILITY_NULLABLE"
                                }
                              }, {
                                "fixedChar": {
                                  "length": 1,
                                  "typeVariationReference": 0,
                                  "nullability": "NULLABILITY_NULLABLE"
                                }
                              }, {
                                "fixedChar": {
                                  "length": 1,
                                  "typeVariationReference": 0,
                                  "nullability": "NULLABILITY_NULLABLE"
                                }
                              }, {
                                "date": {
                                  "typeVariationReference": 0,
                                  "nullability": "NULLABILITY_NULLABLE"
                                }
                              }, {
                                "date": {
                                  "typeVariationReference": 0,
                                  "nullability": "NULLABILITY_NULLABLE"
                                }
                              }, {
                                "date": {
                                  "typeVariationReference": 0,
                                  "nullability": "NULLABILITY_NULLABLE"
                                }
                              }, {
                                "fixedChar": {
                                  "length": 25,
                                  "typeVariationReference": 0,
                                  "nullability": "NULLABILITY_NULLABLE"
                                }
                              }, {
                                "fixedChar": {
                                  "length": 10,
                                  "typeVariationReference": 0,
                                  "nullability": "NULLABILITY_NULLABLE"
                                }
                              }, {
                                "varchar": {
                                  "length": 44,
                                  "typeVariationReference": 0,
                                  "nullability": "NULLABILITY_NULLABLE"
                                }
                              }],
                              "typeVariationReference": 0,
                              "nullability": "NULLABILITY_REQUIRED"
                            }
                          },
                          "namedTable": {
                            "names": ["LINEITEM"]
                          }
                        }
                      },
                      "condition": {
                        "scalarFunction": {
                          "functionReference": 0,
                          "args": [],
                          "outputType": {
                            "bool": {
                              "typeVariationReference": 0,
                              "nullability": "NULLABILITY_NULLABLE"
                            }
                          },
                          "arguments": [{
                            "value": {
                              "selection": {
                                "directReference": {
                                  "structField": {
                                    "field": 10
                                  }
                                },
                                "rootReference": {
                                }
                              }
                            }
                          }, {
                            "value": {
                              "scalarFunction": {
                                "functionReference": 1,
                                "args": [],
                                "outputType": {
                                  "date": {
                                    "typeVariationReference": 0,
                                    "nullability": "NULLABILITY_REQUIRED"
                                  }
                                },
                                "arguments": [{
                                  "value": {
                                    "literal": {
                                      "date": 10561,
                                      "nullable": false,
                                      "typeVariationReference": 0
                                    }
                                  }
                                }, {
                                  "value": {
                                    "literal": {
                                      "intervalDayToSecond": {
                                        "days": 120,
                                        "seconds": 0,
                                        "microseconds": 0
                                      },
                                      "nullable": false,
                                      "typeVariationReference": 0
                                    }
                                  }
                                }],
                                "options": []
                              }
                            }
                          }],
                          "options": []
                        }
                      }
                    }
                  },
                  "expressions": [{
                    "selection": {
                      "directReference": {
                        "structField": {
                          "field": 8
                        }
                      },
                      "rootReference": {
                      }
                    }
                  }, {
                    "selection": {
                      "directReference": {
                        "structField": {
                          "field": 9
                        }
                      },
                      "rootReference": {
                      }
                    }
                  }, {
                    "selection": {
                      "directReference": {
                        "structField": {
                          "field": 4
                        }
                      },
                      "rootReference": {
                      }
                    }
                  }, {
                    "selection": {
                      "directReference": {
                        "structField": {
                          "field": 5
                        }
                      },
                      "rootReference": {
                      }
                    }
                  }, {
                    "scalarFunction": {
                      "functionReference": 2,
                      "args": [],
                      "outputType": {
                        "decimal": {
                          "scale": 0,
                          "precision": 19,
                          "typeVariationReference": 0,
                          "nullability": "NULLABILITY_NULLABLE"
                        }
                      },
                      "arguments": [{
                        "value": {
                          "selection": {
                            "directReference": {
                              "structField": {
                                "field": 5
                              }
                            },
                            "rootReference": {
                            }
                          }
                        }
                      }, {
                        "value": {
                          "scalarFunction": {
                            "functionReference": 3,
                            "args": [],
                            "outputType": {
                              "decimal": {
                                "scale": 0,
                                "precision": 19,
                                "typeVariationReference": 0,
                                "nullability": "NULLABILITY_NULLABLE"
                              }
                            },
                            "arguments": [{
                              "value": {
                                "cast": {
                                  "type": {
                                    "decimal": {
                                      "scale": 0,
                                      "precision": 19,
                                      "typeVariationReference": 0,
                                      "nullability": "NULLABILITY_NULLABLE"
                                    }
                                  },
                                  "input": {
                                    "literal": {
                                      "i32": 1,
                                      "nullable": false,
                                      "typeVariationReference": 0
                                    }
                                  },
                                  "failureBehavior": "FAILURE_BEHAVIOR_UNSPECIFIED"
                                }
                              }
                            }, {
                              "value": {
                                "selection": {
                                  "directReference": {
                                    "structField": {
                                      "field": 6
                                    }
                                  },
                                  "rootReference": {
                                  }
                                }
                              }
                            }],
                            "options": []
                          }
                        }
                      }],
                      "options": []
                    }
                  }, {
                    "scalarFunction": {
                      "functionReference": 2,
                      "args": [],
                      "outputType": {
                        "decimal": {
                          "scale": 0,
                          "precision": 19,
                          "typeVariationReference": 0,
                          "nullability": "NULLABILITY_NULLABLE"
                        }
                      },
                      "arguments": [{
                        "value": {
                          "scalarFunction": {
                            "functionReference": 2,
                            "args": [],
                            "outputType": {
                              "decimal": {
                                "scale": 0,
                                "precision": 19,
                                "typeVariationReference": 0,
                                "nullability": "NULLABILITY_NULLABLE"
                              }
                            },
                            "arguments": [{
                              "value": {
                                "selection": {
                                  "directReference": {
                                    "structField": {
                                      "field": 5
                                    }
                                  },
                                  "rootReference": {
                                  }
                                }
                              }
                            }, {
                              "value": {
                                "scalarFunction": {
                                  "functionReference": 3,
                                  "args": [],
                                  "outputType": {
                                    "decimal": {
                                      "scale": 0,
                                      "precision": 19,
                                      "typeVariationReference": 0,
                                      "nullability": "NULLABILITY_NULLABLE"
                                    }
                                  },
                                  "arguments": [{
                                    "value": {
                                      "cast": {
                                        "type": {
                                          "decimal": {
                                            "scale": 0,
                                            "precision": 19,
                                            "typeVariationReference": 0,
                                            "nullability": "NULLABILITY_NULLABLE"
                                          }
                                        },
                                        "input": {
                                          "literal": {
                                            "i32": 1,
                                            "nullable": false,
                                            "typeVariationReference": 0
                                          }
                                        },
                                        "failureBehavior": "FAILURE_BEHAVIOR_UNSPECIFIED"
                                      }
                                    }
                                  }, {
                                    "value": {
                                      "selection": {
                                        "directReference": {
                                          "structField": {
                                            "field": 6
                                          }
                                        },
                                        "rootReference": {
                                        }
                                      }
                                    }
                                  }],
                                  "options": []
                                }
                              }
                            }],
                            "options": []
                          }
                        }
                      }, {
                        "value": {
                          "scalarFunction": {
                            "functionReference": 4,
                            "args": [],
                            "outputType": {
                              "decimal": {
                                "scale": 0,
                                "precision": 19,
                                "typeVariationReference": 0,
                                "nullability": "NULLABILITY_NULLABLE"
                              }
                            },
                            "arguments": [{
                              "value": {
                                "cast": {
                                  "type": {
                                    "decimal": {
                                      "scale": 0,
                                      "precision": 19,
                                      "typeVariationReference": 0,
                                      "nullability": "NULLABILITY_NULLABLE"
                                    }
                                  },
                                  "input": {
                                    "literal": {
                                      "i32": 1,
                                      "nullable": false,
                                      "typeVariationReference": 0
                                    }
                                  },
                                  "failureBehavior": "FAILURE_BEHAVIOR_UNSPECIFIED"
                                }
                              }
                            }, {
                              "value": {
                                "selection": {
                                  "directReference": {
                                    "structField": {
                                      "field": 7
                                    }
                                  },
                                  "rootReference": {
                                  }
                                }
                              }
                            }],
                            "options": []
                          }
                        }
                      }],
                      "options": []
                    }
                  }, {
                    "selection": {
                      "directReference": {
                        "structField": {
                          "field": 6
                        }
                      },
                      "rootReference": {
                      }
                    }
                  }]
                }
              },
              "groupings": [{
                "groupingExpressions": [{
                  "selection": {
                    "directReference": {
                      "structField": {
                        "field": 0
                      }
                    },
                    "rootReference": {
                    }
                  }
                }, {
                  "selection": {
                    "directReference": {
                      "structField": {
                        "field": 1
                      }
                    },
                    "rootReference": {
                    }
                  }
                }]
              }],
              "measures": [{
                "measure": {
                  "functionReference": 5,
                  "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": 2
                          }
                        },
                        "rootReference": {
                        }
                      }
                    }
                  }],
                  "options": []
                }
              }, {
                "measure": {
                  "functionReference": 5,
                  "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": 3
                          }
                        },
                        "rootReference": {
                        }
                      }
                    }
                  }],
                  "options": []
                }
              }, {
                "measure": {
                  "functionReference": 5,
                  "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": 4
                          }
                        },
                        "rootReference": {
                        }
                      }
                    }
                  }],
                  "options": []
                }
              }, {
                "measure": {
                  "functionReference": 5,
                  "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": 5
                          }
                        },
                        "rootReference": {
                        }
                      }
                    }
                  }],
                  "options": []
                }
              }, {
                "measure": {
                  "functionReference": 6,
                  "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": 2
                          }
                        },
                        "rootReference": {
                        }
                      }
                    }
                  }],
                  "options": []
                }
              }, {
                "measure": {
                  "functionReference": 6,
                  "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": 3
                          }
                        },
                        "rootReference": {
                        }
                      }
                    }
                  }],
                  "options": []
                }
              }, {
                "measure": {
                  "functionReference": 6,
                  "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": 6
                          }
                        },
                        "rootReference": {
                        }
                      }
                    }
                  }],
                  "options": []
                }
              }, {
                "measure": {
                  "functionReference": 7,
                  "args": [],
                  "sorts": [],
                  "phase": "AGGREGATION_PHASE_INITIAL_TO_RESULT",
                  "outputType": {
                    "i64": {
                      "typeVariationReference": 0,
                      "nullability": "NULLABILITY_REQUIRED"
                    }
                  },
                  "invocation": "AGGREGATION_INVOCATION_ALL",
                  "arguments": [],
                  "options": []
                }
              }]
            }
          },
          "sorts": [{
            "expr": {
              "selection": {
                "directReference": {
                  "structField": {
                    "field": 0
                  }
                },
                "rootReference": {
                }
              }
            },
            "direction": "SORT_DIRECTION_ASC_NULLS_LAST"
          }, {
            "expr": {
              "selection": {
                "directReference": {
                  "structField": {
                    "field": 1
                  }
                },
                "rootReference": {
                }
              }
            },
            "direction": "SORT_DIRECTION_ASC_NULLS_LAST"
          }]
        }
      },
      "names": ["L_RETURNFLAG", "L_LINESTATUS", "SUM_QTY", "SUM_BASE_PRICE", "SUM_DISC_PRICE", "SUM_CHARGE", "AVG_QTY", "AVG_PRICE", "AVG_DISC", "COUNT_ORDER"]
    }
  }],
  "expectedTypeUrls": []
}
