Skip to content

[Bug] parse_url rejects a port above 65535, Spark returns the requested part #365

Open

Description

@andygrove

Describe the bug

parse_url treats a URL with a port above 65535 as invalid. Spark parses it with java.net.URI, which does not check the port's range, so it returns the requested part.

To Reproduce

SELECT parse_url('http://spark.apache.org:99999/path', 'HOST');

datafusion-spark returns NULL with ANSI mode off, and raises InvalidPort with ANSI mode on.

Spark 4.2.0 returns spark.apache.org in both modes.

Expected behavior

spark.apache.org, as in Spark. The other parts, such as PATH and AUTHORITY, should also match Spark for such a URL.

Additional context

Raised in the review of #340. The records are in url/parse_url.slt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions