Skip to content

Add support for XPath functions #22254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

weijiii
Copy link
Member

@weijiii weijiii commented Jun 4, 2024

Description

Additional context and related issues

  • The case with XPathConstants.NODE is not utilized in both Hive and Spark. xpath_node may not be needed here. For now the behavior is following that of the case with NODESET, returning the content provided by Node#getNodeValue

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text:

# General
* Add support for XPath functions. ({issue}`3888`)

@cla-bot cla-bot bot added the cla-signed label Jun 4, 2024
@weijiii weijiii changed the title Add XPathFunctions Support XPathFunctions Jun 4, 2024
@weijiii weijiii changed the title Support XPathFunctions Add support for XPath functions Jun 4, 2024
@weijiii weijiii force-pushed the xml-func branch 2 times, most recently from 81b44f9 to c220151 Compare June 4, 2024 07:36
@weijiii weijiii added the enhancement New feature or request label Jun 4, 2024
@github-actions github-actions bot added the docs label Jun 4, 2024
@weijiii weijiii marked this pull request as ready for review June 4, 2024 09:10
@weijiii weijiii force-pushed the xml-func branch 8 times, most recently from 570a2ca to 82463d0 Compare June 4, 2024 18:52
@findepi
Copy link
Member

findepi commented Jun 4, 2024

cc @nineinchnick

@weijiii weijiii force-pushed the xml-func branch 2 times, most recently from 0bbdc92 to 64662ca Compare June 4, 2024 23:29
@weijiii
Copy link
Member Author

weijiii commented Jun 12, 2024

@nineinchnick Can you take a look when you get a chance? Thanks!

@nineinchnick
Copy link
Member

I'd love to have these functions available, but @martint has to review it, as the function names and signatures need to be approved by him first.

@weijiii
Copy link
Member Author

weijiii commented Jun 13, 2024

I'd love to have these functions available, but @martint has to review it, as the function names and signatures need to be approved by him first.

Oh sure no worries! Thanks

@martint
Copy link
Member

martint commented Jun 21, 2024

We should look into whether there's any precedent for this in the SQL specification or other databases before we settle on specific syntax and semantics.

Copy link

This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua

@github-actions github-actions bot added the stale label Jul 15, 2024
@mosabua mosabua added stale-ignore Use this label on PRs that should be ignored by the stale bot so they are not flagged or closed. and removed stale labels Jul 15, 2024
@mosabua
Copy link
Member

mosabua commented Jul 15, 2024

Added stale-ignore label to keep this PR open.

@weijiii could you provide some information about precedent in the SQL specification or other databases

This will help us decide a path forward and help with reviews by @martint and others.

@weijiii
Copy link
Member Author

weijiii commented Jul 25, 2024

Added stale-ignore label to keep this PR open.

@weijiii could you provide some information about precedent in the SQL specification or other databases

This will help us decide a path forward and help with reviews by @martint and others.

I did not get to work on this PR for a while. I will look into it

@chgl
Copy link

chgl commented Aug 3, 2024

Very interested in this as well! To add some data points:

  1. in PostgreSQL there's xpath and xpath_exists (https://www.postgresql.org/docs/16/functions-xml.html#FUNCTIONS-XML-PROCESSING)
  2. in Oracle SQL there's the now deprecated EXTRACTVALUE (https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/EXTRACTVALUE.html) - the successor functions technically uses XQuery.
  3. In MySQL there's an ExtractValue as well (https://dev.mysql.com/doc/refman/8.4/en/xml-functions.html#function_extractvalue)

The ANSI SQL standard has a part on XML: https://webstore.ansi.org/standards/iso/isoiec9075142023 which I don't have access to, but a preview is available at: https://webstore.ansi.org/preview-pages/INCITS/preview_INCITS+ISO+IEC+9075-14-2008.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed docs enhancement New feature or request stale-ignore Use this label on PRs that should be ignored by the stale bot so they are not flagged or closed. syntax-needs-review
Development

Successfully merging this pull request may close these issues.

Support for XPath functions
7 participants