Skip to content

Conversation

PragmaTwice
Copy link
Member

See examples:

  ASSERT_EQ(PassManager::Execute(ia_passes, *Parse("select * from a where a < 1 and a < 3"))->Dump(),
            "select * from a where a < 1");
  ASSERT_EQ(PassManager::Execute(ia_passes, *Parse("select * from a where a < 1 or a < 3"))->Dump(),
            "select * from a where a < 3");
  ASSERT_EQ(PassManager::Execute(ia_passes, *Parse("select * from a where a = 1 and a < 3"))->Dump(),
            "select * from a where a = 1");
  ASSERT_EQ(PassManager::Execute(ia_passes, *Parse("select * from a where a = 1 or a < 3"))->Dump(),
            "select * from a where a < 3");
  ASSERT_EQ(PassManager::Execute(ia_passes, *Parse("select * from a where a = 1 or a = 3"))->Dump(),
            "select * from a where (or a = 1, a = 3)");
  ASSERT_EQ(PassManager::Execute(ia_passes, *Parse("select * from a where a != 1"))->Dump(),
            "select * from a where a != 1");
  ASSERT_EQ(PassManager::Execute(ia_passes, *Parse("select * from a where a != 1 and a != 2"))->Dump(),
            "select * from a where (and a != 1, a != 2)");
  ASSERT_EQ(
      PassManager::Execute(ia_passes, *Parse("select * from a where a >= 0 and a >= 1 and a < 4 and a != 2"))->Dump(),
      fmt::format("select * from a where (or (and a >= 1, a < 2), (and a >= {}, a < 4))", IntervalSet::NextNum(2)));
  ASSERT_EQ(PassManager::Execute(ia_passes, *Parse("select * from a where a != 1 and b > 1 and b = 2"))->Dump(),
            "select * from a where (and a != 1, b = 2)");

@PragmaTwice PragmaTwice requested review from git-hulk and mapleFU April 20, 2024 04:39
git-hulk
git-hulk previously approved these changes Apr 20, 2024
Copy link

@PragmaTwice PragmaTwice merged commit 899216d into apache:unstable Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants