Class ProjectionSlot

java.lang.Object
dev.frostlake.executor.ProjectionSlot

public final class ProjectionSlot extends Object
WHICH select item was being evaluated when a row-time failure was raised. A DML statement's write failure names the TARGET COLUMN — DML operation to table VEMPTY failed on column D with error: … — but a failure raised while the SOURCE QUERY runs has no column attached to it: the query fails as a whole, several layers below the statement that knows what the columns are for.

So the projection records the item it was on as the failure leaves it, and the DML layer reads that back to name the column. The record is written ONLY on the failing path and is cleared by the reader, which is what keeps it out of the way of every query that succeeds.

Live names the FIRST failing projection when more than one would fail (INSERT INTO twobad SELECT COALESCE(va, d), COALESCE(va, d) names D1), which is what recording the item the evaluation stopped on gives for free.

  • Method Details

    • reset

      public static void reset()
      Forget any earlier record, before running a query whose failure is about to be attributed.
    • failedAt

      public static void failedAt(int index)
      Record the item a failure is leaving.
      Parameters:
      index - the select item's position
    • takeFailedSlot

      public static int takeFailedSlot()
      The recorded item, and forget it.
      Returns:
      the position, or -1 when nothing was recorded