Skip to content

[Feature] Add ST_CoordDim and ST_Dimension geo functions#61442

Open
batuhanYagmurr wants to merge 7 commits intoapache:masterfrom
batuhanYagmurr:feature/geo-coorddim-dimension
Open

[Feature] Add ST_CoordDim and ST_Dimension geo functions#61442
batuhanYagmurr wants to merge 7 commits intoapache:masterfrom
batuhanYagmurr:feature/geo-coorddim-dimension

Conversation

@batuhanYagmurr
Copy link
Copy Markdown

Add two new geo scalar functions:

  • ST_CoordDim: Returns coordinate dimension of geometry (always 2 for 2D)
  • ST_Dimension: Returns topological dimension (Point=0, Line=1, Polygon=2)

FE: Added expression classes, registered in BuiltinScalarFunctions, added visitor methods in ScalarFunctionVisitor.
BE: Added struct implementations and registered in functions_geo.cpp.

What problem does this PR solve?

Issue Number: close #48203

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@benvdh
Copy link
Copy Markdown

benvdh commented Apr 6, 2026

@batuhanYagmurr Thanks for adding these functions! I'm not a Doris developer, but out of curiosity had a look at your code.

I noticed the tests are still missing, so you might want to add those... See this PR for some examples of how they can be added...

@batuhanYagmurr batuhanYagmurr force-pushed the feature/geo-coorddim-dimension branch 3 times, most recently from 1dfcff5 to 276e58d Compare April 7, 2026 03:48
@batuhanYagmurr batuhanYagmurr force-pushed the feature/geo-coorddim-dimension branch from 2195709 to 433f20b Compare April 7, 2026 04:51
@benvdh
Copy link
Copy Markdown

benvdh commented Apr 7, 2026

@zclllyybb in the original issue (#48203) you mention that PR's for new functions should automatically request your review, though I didn't see that happen with this PR... so do you think you could review this one?

@feiniaofeiafei
Copy link
Copy Markdown
Contributor

run buildall

@benvdh
Copy link
Copy Markdown

benvdh commented Apr 7, 2026

@feiniaofeiafei I see some tests are failing, but the results cannot be viewed, at least not by me... so not sure if @batuhanYagmurr can see them too, to fix the issues (if they arose due to the code in this PR)... can you share with @batuhanYagmurr what the errors are that need to be worked on?

@zclllyybb
Copy link
Copy Markdown
Contributor

@batuhanYagmurr the compilation failed because of fe checkstyle

Fix import ordering and indentation to comply with Doris checkstyle rules.
@batuhanYagmurr batuhanYagmurr force-pushed the feature/geo-coorddim-dimension branch from 3f37907 to ab84918 Compare April 7, 2026 16:10
@batuhanYagmurr
Copy link
Copy Markdown
Author

@zclllyybb Fixed the FE checkstyle errors. Could you please review again?

@batuhanYagmurr batuhanYagmurr force-pushed the feature/geo-coorddim-dimension branch from 3abb8bd to a517378 Compare April 7, 2026 19:45
Copy link
Copy Markdown
Author

@batuhanYagmurr batuhanYagmurr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests have been added to test_gis_function.groovy for both ST_CoordDim and ST_Dimension functions.
@zclllyybb review please.

@feiniaofeiafei
Copy link
Copy Markdown
Contributor

run buildall

@benvdh
Copy link
Copy Markdown

benvdh commented Apr 8, 2026

@batuhanYagmurr The pipeline ran again, now I see some errors in the backend tests... I also see you can access the TeamCity server now (through the guest login), so you should be able to have a look at the build log yourself...

@feiniaofeiafei thx for running the builds... I see in my browser the connection to TeamCity lacks a TLS certificate, perhaps something to fix using something like Let's Encrypt or if it runs on kubernetes cert manager...?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Good First Issue] Support All SQL Functions in Other SQL System

5 participants