Class S3PathResolver

java.lang.Object
dev.frostlake.config.S3PathResolver

public class S3PathResolver extends Object
Resolves Snowflake-style S3 URLs (s3://bucket/key) to a local filesystem path, so files that live in S3 in production — most usefully the JAR(s) named in a UDF/procedure IMPORTS clause — can be served from local disk in the local/CI testing the engine targets. Driven by two engine settings:
  • stage.s3.localMappings — explicit prefix overrides, ';'-separated s3prefix=localdir pairs, e.g. "s3://prod-bucket/lib/=/opt/jars; s3://data/=/srv/data". The longest matching prefix wins, and the remainder of the URL is appended to the mapped directory.
  • stage.s3.localRoot — the fallback base; an unmapped s3://bucket/key resolves to <localRoot>/bucket/key. Defaults to ~/.frostlake_stages/s3.
  • Constructor Details

    • S3PathResolver

      public S3PathResolver(EngineConfig config)
  • Method Details

    • isS3Url

      public static boolean isS3Url(String url)
      True if url is an s3://… reference.
    • toLocalPath

      public Path toLocalPath(String s3Url)
      Map an s3://bucket/key URL to its local filesystem path. An explicit stage.s3.localMappings entry wins (longest matching prefix); with no match the key is placed under the configured local root (s3://bucket/key → <localRoot>/bucket/key).
      Throws:
      IllegalArgumentException - if s3Url is not an s3:// URL