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

Pivot statement unsupported? #57

Open
ericemc3 opened this issue Mar 15, 2025 · 3 comments
Open

Pivot statement unsupported? #57

ericemc3 opened this issue Mar 15, 2025 · 3 comments
Labels
bug Something isn't working extension Pertaining to the UI extension code, which is in this repository.

Comments

@ericemc3
Copy link

CREATE TABLE cities (
    country VARCHAR, name VARCHAR, year INTEGER, population INTEGER
);
INSERT INTO cities VALUES
    ('NL', 'Amsterdam', 2000, 1005),
    ('NL', 'Amsterdam', 2010, 1065),
    ('NL', 'Amsterdam', 2020, 1158),
    ('US', 'Seattle', 2000, 564),
    ('US', 'Seattle', 2010, 608),
    ('US', 'Seattle', 2020, 738),
    ('US', 'New York City', 2000, 8015),
    ('US', 'New York City', 2010, 8175),
    ('US', 'New York City', 2020, 8772);

Second cell:

PIVOT cities
ON year
USING first(population);

=> Invalid Input Error: Cannot prepare multiple statements at once!

@jraymakers
Copy link
Collaborator

Ah, yes, this is a known problem in the interaction between now PIVOT is implemented and the PendingQuery C++ API call we use to run queries. PIVOT gets expanded into multiple statements, which PendingQuery can't handle.

We can probably address this by using Query, at least in this case. We'll have to think a bit about the best way to do that, without negatively affecting other queries (since PendingQuery provides some advantages, such as prompt cancellation).

@jraymakers jraymakers added the bug Something isn't working label Mar 16, 2025
@pugpapa
Copy link

pugpapa commented Mar 18, 2025

Is there a workaround currently?

@jraymakers
Copy link
Collaborator

There's no workaround that I'm aware of.

@jraymakers jraymakers added the extension Pertaining to the UI extension code, which is in this repository. label Mar 19, 2025
@Y-- Y-- marked this as a duplicate of #112 Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working extension Pertaining to the UI extension code, which is in this repository.
Projects
None yet
Development

No branches or pull requests

3 participants