Repository navigation
DuckDB: generate ATAN2 and POWER with two arguments - #1378
Open
555aaditya wants to merge 1 commit into
Open
555aaditya wants to merge 1 commit into
555aaditya wants to merge 1 commit into
Conversation
Both functions take two arguments (atan2(DOUBLE, DOUBLE) and power(DOUBLE, DOUBLE) are their only signatures in DuckDB 1.3.0.0), but they were declared with one. DuckDB rejected every such call with a binder error, which the expected error "You might need to add explicit type casts." ignores, so the generated queries were wasted.
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.
DuckDBExpressionGenerator.DBFunctiondeclaresATAN2andPOWERwith one argument, but both functions take two. DuckDB rejects every such call with a binder error.DuckDBErrorsignores "You might need to add explicit type casts.", so every query that picked one of these two functions was silently wasted.Checked against DuckDB 1.3.0.0 (the driver version in
pom.xml), using a throwaway JDBC program:The change declares both functions with two arguments. I looked at the other
DBFunctionentries and did not find another one with a wrong argument count, but I only checked them by reading, not by running each one.I did not add a regression test. An embedded-DuckDB unit test is easy to write (I wrote one, and it fails on
mainand passes with this change), but on macOS it crashed the forked test JVM when it ran afterTestStatementReducer:testSQLite3WithStatementReducerleaves itsdatabase0..Nthreads running SQLite code after the timeout, and loading DuckDB into that JVM then aborted withPOINTER_BEING_FREED_WAS_NOT_ALLOCATEDin DuckDB'szone_free. I did not want to add a flaky test to the unit tier, and I could not check Linux. If you prefer a test insqlancer.dbmsplus a CI line, I am happy to add it.Verified on macOS (arm64), OpenJDK 11.0.33, Maven 3.10.1:
mvn -B verify -DskipTests=true: BUILD SUCCESS.python3 src/check_names.py: exit 0.mvn -Djacoco.skip=true '-Dtest=!sqlancer.dbms.**,!sqlancer.qpg.**' test: 125 tests, 0 failures, 3 skipped (the same as onorigin/main).mvn -Djacoco.skip=true -Dtest=TestDuckDBNoREC test: passes (307 s).mvn -Djacoco.skip=true -Dtest=TestDuckDBTLP test: passes (304 s).@mrigger