Class DmlWriteTarget

java.lang.Object
dev.frostlake.executor.DmlWriteTarget

public final class DmlWriteTarget extends Object
The envelope live wraps a DML write failure in — DML operation to table T failed on column C with error: … — around whatever sentence the value itself earned.

★ THE ENVELOPE IS THE DML LAYER'S, NOT THE VALUE'S. The same SELECT COALESCE(va, d) FROM vf that a CTAS wraps is answered bare when written on its own, so it belongs to the statement writing the rows rather than to the conversion that failed.

★ HOW THE TABLE IS NAMED DEPENDS ON THE STATEMENT. A CTAS always spells it FULLY QUALIFIED, even when the CREATE named it bare; every other DML echoes the name the statement wrote, upper-cased. Both live-measured in one run. Only the CTAS half is applied here so far — see the task list for the written-name half, which needs the spelling threaded down from each handler.

  • Method Details

    • isRowTimeFailure

      public static boolean isRowTimeFailure(RuntimeException failure)
      Whether a failure belongs INSIDE the envelope. A COMPILATION refusal does not: live answers CREATE TABLE t AS SELECT NOSUCHFN(x) … with the bare "SQL compilation error" sentence, because the statement never got far enough to write anything. Only a failure raised while VALUES were being produced is a DML failure, and those carry no prefix at all — which is what makes the prefix the discriminator rather than a list of sentences.
      Parameters:
      failure - the failure
      Returns:
      true when the envelope applies
    • failedOnColumn

      public static RuntimeException failedOnColumn(String table, String column, RuntimeException failure)
      Parameters:
      table - the table as it should be named
      column - the column the failure is attributed to
      failure - the inner failure, whose sentence is kept verbatim
      Returns:
      the wrapped refusal