Draft
Conversation
…to modify functions internally
Owner
Author
|
By the way, only the last 3 commits are related to this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR refers to what has been discussed in #92.
I implemented what I explained in this comment, so we can experiment from there.
This is not the definitive approach, as we still need to discuss if this is the best way, and find if there are weaknesses in this method before moving forward.
I will describe the 2-type approach to implement macros.
Simple functions
They just have a 1-to-1 function relationship. For example:
That will fully integrate
ddbs_is_simple().Complex functions
Those that use one
duckspatialfunction to execute more than 1DuckDBfunctions. For example,ddbs_area()usesST_Area()orST_Area_Spheroid()depending on the CRS. Therefore, I implemented a macro that will use one or the other depending on the CRS, found in thecrs_duckspatialcolumn:This has an obvious flaw: if the CRS is stored in a different column name, it won't work. However, I wouldn't give so much of impotance to this. When DuckDB v1.5.0 is released, that will be replaced by
ST_SRID()or whichever will be the function that returns the CRS.