@DisplayName("TestSQL: INSERT OVERWRITE duplicate check source")
  @ParameterizedTest()
  @MethodSource
  public void testSourceDuplicateCheck(
      TableFormat format,
      PrimaryKeySpec keySpec,
      PartitionSpec ptSpec,
      String mode,
      boolean duplicateSource,
      boolean expectChecked) {
    spark().conf().set(OVERWRITE_MODE_KEY, mode);
    spark().conf().set(SparkSQLProperties.CHECK_SOURCE_DUPLICATES_ENABLE, true);

    table =
        createTarget(
            SCHEMA, builder -> builder.withPartitionSpec(ptSpec).withPrimaryKeySpec(keySpec));
    List<Record> sourceData = Lists.newArrayList(this.base);
    if (duplicateSource) {
      sourceData.addAll(this.source);
    }
    createViewSource(SCHEMA, sourceData);

    boolean failed = false;
    try {
      sql("INSERT OVERWRITE " + target() + " SELECT * FROM " + source());
    } catch (Exception e) {
      failed = true;
    }
    Assertions.assertEquals(expectChecked, failed);
  }
1. dynamic insert overwrite 2. static insert overwrite 3. for un-partitioned table 3. duplicate
check for insert overwrite 4. optimize write is work for insert overwrite
amoro-format-mixed/amoro-mixed-spark/v3.3/amoro-mixed-spark-3.3/src/test/java/org/apache/amoro/spark/test/suites/sql/TestInsertOverwriteSQL.java