Class StageFileResolver

java.lang.Object
dev.frostlake.executor.StageFileResolver
All Implemented Interfaces:
StageFileLocator

public class StageFileResolver extends Object implements StageFileLocator
Resolves the stage references TO_FILE is given, reusing the executor's own QueryExecutor.resolveCopyBaseDir(String) — the one place that already knows how @stage, @db.schema.stage, @~ and @%table map onto local directories. Only the two descriptor-facing names are computed here.

The STAGE display was measured live. A named stage always renders fully qualified and upper-cased regardless of how the caller wrote it — from a session on PROBE135B_DB.OTHER, TO_FILE('@s.sse2/hello.txt') reports @PROBE135B_DB.S.SSE2 — so missing parts are filled from the current database and schema. The user stage renders @"~" and a table stage renders the bare upper-cased table name (@TSTG), with no database or schema even when the reference carried one.

  • Constructor Details

  • Method Details

    • locate

      public StagedFile locate(String location)
      Description copied from interface: StageFileLocator
      Resolve a stage reference to the file it names.
      Specified by:
      locate in interface StageFileLocator
      Parameters:
      location - a stage reference: @stage/path, @db.schema.stage/path, @~/path or @%table/path
      Returns:
      the resolved file, or null when the reference names no stage this engine can reach (the caller turns that into Snowflake's "was not found" error)