)]}'
{
  "commit": "f8d9ad6bdcb28d84649d5b3a2ace9cc3f8ed4172",
  "tree": "b411e89bb907781e7b2eecff1a23433320aacca4",
  "parents": [
    "1a7b222acf984624c1e0b1c99fb6a660994ddf2c"
  ],
  "author": {
    "name": "englefly",
    "email": "zhouminghong@selectdb.com",
    "time": "Thu Jun 25 15:44:53 2026 +0800"
  },
  "committer": {
    "name": "englefly",
    "email": "zhouminghong@selectdb.com",
    "time": "Thu Jun 25 20:55:53 2026 +0800"
  },
  "message": "do not merge this commit into master.\nit contains several un-safe commits for pk-fk related fix\n\nfix: guard Count(*) child access with arity() check in PushDownAggThroughJoinOnPkFk\n\nCOUNT(*) has no arguments; calling child(0) on it throws\nArrayIndexOutOfBoundsException. Added arity() \u003e 0 guard before\naccessing Count\u0027s child slot for FK rewrite.\n\nRegression test testCountStar() added to verify COUNT(*) with\nPK/FK join does not crash.\n\nadd constraint for tpch tools\n\nfeat: eliminate FD-redundant group-by keys via ANY_VALUE wrapping\n\nWhen a group-by key is functionally dependent on another key\n(e.g. s_suppkey -\u003e s_name via PK) but required in output,\nremove it from GROUP BY and wrap with ANY_VALUE().\n\nPreviously EliminateGroupByKey kept such keys in GROUP BY to\npreserve SQL semantics. Now they are replaced with ANY_VALUE\nwrappers in the output, allowing the group-by set to be\nminimized while keeping the column in SELECT.\n\nPublic findCanBeRemovedExpressions() API preserved for backward\ncompatibility. Internal logic split into FindResult with separate\nremoveExpression and wrapWithAnyValue sets.\n\nTest: testEliminateByPkWithOutputNeeded verifies ANY_VALUE wrapping\nwhen SELECT contains an FD-redundant group-by key.\n\nfix: add PK constraint unique slots in computeUnique\n\nAdded addUniqueFromPk() in LogicalOlapScan.computeUnique to read\nPrimaryKeyConstraint from ConstraintManager and register PK columns\nas unique slots. This cascades to FDs via the computeDataTrait\nmechanism, enabling EliminateGroupByKey to find FD-redundant\ngroup-by keys.\n\nremove @DependsRules({EliminateGroupBy.class, ColumnPruning.class})\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4e1b3117ab53ff89e49eb4740d1fe19f026d357d",
      "old_mode": 33188,
      "old_path": "fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/EliminateGroupByKey.java",
      "new_id": "c849e3ce164537e1beb633dd3af9a220e332db13",
      "new_mode": 33188,
      "new_path": "fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/EliminateGroupByKey.java"
    },
    {
      "type": "modify",
      "old_id": "28dcc005ce41bb8ff635e5fdcee05076cb2d0f29",
      "old_mode": 33188,
      "old_path": "fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownAggThroughJoinOnPkFk.java",
      "new_id": "f1d6e0816d112c65088938c9be5e0f2d79e51859",
      "new_mode": 33188,
      "new_path": "fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownAggThroughJoinOnPkFk.java"
    },
    {
      "type": "modify",
      "old_id": "66e0dee8aa0d43894c4757f82553ef1efa8fb42e",
      "old_mode": 33188,
      "old_path": "fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java",
      "new_id": "205319dd52acb37016745b3ba86df97b9c125c64",
      "new_mode": 33188,
      "new_path": "fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java"
    },
    {
      "type": "modify",
      "old_id": "7362c81e5afe0b373407c3a8e4c753c632866ca6",
      "old_mode": 33188,
      "old_path": "fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/EliminateGroupByKeyTest.java",
      "new_id": "dbca6cd47597ff70093d585d4dfb3b6b8d5adebe",
      "new_mode": 33188,
      "new_path": "fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/EliminateGroupByKeyTest.java"
    },
    {
      "type": "modify",
      "old_id": "f2dbf786561317a843cbd3e72784989a50afa31e",
      "old_mode": 33188,
      "old_path": "fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/PushDownAggThroughJoinOnPkFkTest.java",
      "new_id": "6934032920807a08e78544cabbc522e2ff01df90",
      "new_mode": 33188,
      "new_path": "fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/PushDownAggThroughJoinOnPkFkTest.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b5dd9d8da2041d3f6f8778d3f0bd04ae3e6fbe79",
      "new_mode": 33188,
      "new_path": "tools/tpch-tools/constraints/drop-fk-constraints.sql"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "163196d5e2f8dc077beb44d4d145c504e1dabf10",
      "new_mode": 33188,
      "new_path": "tools/tpch-tools/constraints/drop-pk-uk-constraints.sql"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "4ac0fdc33623176d294305565c0a72d40ae93600",
      "new_mode": 33188,
      "new_path": "tools/tpch-tools/constraints/tpch-fd.sql"
    }
  ]
}
