Skip to content
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

reports struct_extract error when run a sql #2713

Closed
2 tasks done
l1t1 opened this issue Dec 2, 2021 · 0 comments · Fixed by #2719
Closed
2 tasks done

reports struct_extract error when run a sql #2713

l1t1 opened this issue Dec 2, 2021 · 0 comments · Fixed by #2719

Comments

@l1t1
Copy link

l1t1 commented Dec 2, 2021

What happens?

reports struct_extract error when run a sql in duckdb v0.3.2dev, that sql can run in v0.3.0 and v0.3.1 correctly

seems related with #2554

To Reproduce

WITH RECURSIVE
input(sud) AS (
VALUES('53..7....6..195....98....6.8...6...34..8.3..17...2...6.6....28....419..5....8..79')
),
digits(z, lp) AS (
SELECT CAST(lp+1 AS TEXT), lp::int+1 FROM range(0,9) t(lp)
),
x(s, ind) AS (
SELECT sud, instr(sud, '.') FROM input
UNION ALL
SELECT
substr(s, 1, ind::int-1) || z || substr(s, ind::int+1),
instr( substr(s, 1, ind::int-1) || z || substr(s, ind::int+1), '.' )
FROM x, digits AS z
WHERE ind::int>0
AND NOT EXISTS (
SELECT 1
FROM digits AS lp
WHERE z.z = substr(s, ((ind::int-1)/9)*9 + lp, 1)
OR z.z = substr(s, ((ind::int-1)%9) + (lp-1)*9 + 1, 1)
OR z.z = substr(s, (((ind::int-1)/3) % 3) * 3
+ ((ind::int-1)/27) * 27 + lp
+ ((lp-1) / 3) * 6, 1)
)
)
SELECT s FROM x WHERE ind::int=0;


---run in v0.3.0 46a0fc50a /v0.3.1 88aa81c6b5346789126721953481983425678597614234268537917139248569615372842874196353452861... │

---run in v0.3.2-dev173 a73d33c14 /v0.3.2-dev330 ae8562793
Error: Binder Error: No function matches the given name and argument types 'struct_extract(VARCHAR, VARCHAR)'. You might need to add explicit type cas
ts.
        Candidate functions:
        struct_extract(STRUCT, VARCHAR) -> ANY

Environment (please complete the following information):

  • OS: [e.g. iOS]windows7 x64
  • DuckDB Version: [e.g. 22]0.3.2dev
  • DuckDB Client: [e.g. Python]CLI

Before Submitting

  • Have you tried this on the latest master branch?
  • Python: pip install duckdb --upgrade --pre
  • R: install.packages("https://github.com/duckdb/duckdb/releases/download/master-builds/duckdb_r_src.tar.gz", repos = NULL)
  • Other Platforms: You can find binaries here or compile from source.
  • Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
Mytherin added a commit to Mytherin/duckdb that referenced this issue Dec 2, 2021
Mytherin added a commit that referenced this issue Dec 2, 2021
Fix #2713: correctly bind multi-part column references in correlated subqueries
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 a pull request may close this issue.

1 participant