@Override
  public List<DataLayoutStrategy> generate() {
    return Collections.singletonList(generateCompactionStrategy());
  }
@Test
  void testStrategySanityCheck() throws Exception {
    final String testTable = "db.test_table_sanity_check";
    try (SparkSession spark = getSparkSession()) {
      spark.sql("USE openhouse");
      spark.sql(
          String.format(
              "create table %s (id int, data string, ts timestamp) partitioned by (days(ts))",
              testTable));

      // produce 2 partitions
      for (int i = 0; i < 3; ++i) {
        spark.sql(
            String.format(
                "insert into %s values (0, 'data', cast('2024-07-15 00:1%d:34' as timestamp))",
                testTable, i));
      }
      for (int i = 0; i < 3; ++i) {
        spark.sql(
            String.format(
                "insert into %s values (0, 'data', cast('2024-07-16 00:1%d:34' as timestamp))",
                testTable, i));
      }

      TableFileStats tableFileStats =
          TableFileStats.builder().tableName(testTable).spark(spark).build();
      TablePartitionStats tablePartitionStats =
          TablePartitionStats.builder().tableName(testTable).spark(spark).build();
      OpenHouseDataLayoutStrategyGenerator strategyGenerator =
          OpenHouseDataLayoutStrategyGenerator.builder()
              .tableFileStats(tableFileStats)
              .tablePartitionStats(tablePartitionStats)
              .build();
      List<DataLayoutStrategy> strategies = strategyGenerator.generate();
      Assertions.assertEquals(1, strategies.size());
      DataLayoutStrategy strategy = strategies.get(0);
      // few groups, expect 1 commit
      Assertions.assertEquals(1, strategy.getConfig().getPartialProgressMaxCommits());
      Assertions.assertTrue(strategy.getConfig().isPartialProgressEnabled());

      Assertions.assertTrue(
          strategy.getGain() == 5, "Gain for 6 files compaction in 2 partitions should be 5");
      Assertions.assertTrue(
          strategy.getCost() < 1.0, "Cost for 6 files compaction should be negligible");
      Assertions.assertTrue(
          strategy.getScore() < 10.0, "Score for 6 files compaction should be negligible");
    }
  }