Class ParseUrl


public class ParseUrl extends TextArgumentFunction
PARSE_URL(url [, permissive]) — parses a URL into a VARIANT OBJECT with Snowflake's keys, in ALPHABETICAL order (live-verified): fragment, host, parameters, path, port, query, scheme. port is a string; parameters is an object of the decoded query key/value pairs; missing components are JSON null. The leading slash is stripped from path and any userinfo is folded into host (e.g. user:pass@host), matching Snowflake. A parse failure (including a missing scheme) raises; when permissive is 1 it instead returns an object with only an error key. NULL url yields NULL.
  • Constructor Details

    • ParseUrl

      public ParseUrl()
  • Method Details

    • evaluate

      public Object evaluate(List<Object> args)
      Description copied from class: BuiltInFunction
      Computes the function's result over its already-evaluated argument values. A SQL NULL argument arrives as Java null, and returning null makes the SQL result NULL.
      Specified by:
      evaluate in class BuiltInFunction
      Parameters:
      args - the argument values, in call order
      Returns:
      the function's value for these arguments, or null for SQL NULL
    • getMinArgCount

      public int getMinArgCount()
      Description copied from class: BuiltInFunction
      The fewest arguments a call to this function may pass; fewer is an argument-count error.
      Specified by:
      getMinArgCount in class BuiltInFunction
      Returns:
      the minimum accepted argument count
    • getMaxArgCount

      public int getMaxArgCount()
      Description copied from class: BuiltInFunction
      The most arguments a call to this function may pass; Integer.MAX_VALUE marks a variadic function (see BuiltInFunction.isVariadic()).
      Specified by:
      getMaxArgCount in class BuiltInFunction
      Returns:
      the maximum accepted argument count