Class FileFormatReference

java.lang.Object
dev.frostlake.executor.FileFormatReference

public final class FileFormatReference extends Object
A FILE_FORMAT that names a file format. Every spelling that gives a NAME rather than a TYPE reaches the same refusal on a real account when nothing holds the name - a bare word, a string literal and FORMAT_NAME = … alike, on CREATE STAGE, ALTER STAGE and COPY INTO:
   SQL compilation error:
   File format 'NOSUCHFORMAT' does not exist or not authorized.
 

A bare word is a NAME, not a type: FILE_FORMAT = CSV is refused unless a file format called CSV exists, where FILE_FORMAT = (TYPE = CSV) declares the type and needs nothing. A qualified name is echoed in full. The check comes before existence is answered, so CREATE STAGE IF NOT EXISTS over a stage that already stands still refuses (live-verified).

  • Method Details

    • require

      public static void require(Catalog catalog, String writtenName)
      Refuse a name no file format holds.
      Parameters:
      catalog - the catalog to resolve against
      writtenName - the name as the statement spells it, or null when a TYPE was declared instead