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

WITH statements and subqueries now seem to work #86

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

Dtenwolde
Copy link
Contributor

@Dtenwolde Dtenwolde commented Feb 6, 2024

Fixes #85

The following queries are now possible

-FROM GRAPH_TABLE (snb_projected
    MATCH (m:message)
    COLUMNS (m.id)
    ) tmp, (SELECT id from message limit 1)
LIMIT 10;
-WITH message_count AS (
    SELECT count(*) as m_count
    FROM Message m
    WHERE m.creationDate < '2010-05-27 11:16:36.013'
)
SELECT year, isComment,
    CASE    WHEN m_length < 40 THEN 0
            WHEN m_length < 80 THEN 1
            WHEN m_length < 160 THEN 2
            ELSE 3 END as lengthCategory,
    count(*) as messageCount,
    avg(m_length) as averageMessageLength,
    sum(m_length) as sumMessageLength,
    count(*) / mc.m_count as percentageOfMessages
FROM GRAPH_TABLE(snb_projected
    MATCH (message:Message where message.creationDate < '2010-05-27 11:16:36.013')
    COLUMNS (date_part('year', message.creationDate::TIMESTAMP) as year, message.ImageFile is NULL as isComment, message.length as m_length, message.id)
    ) tmp, message_count mc
GROUP BY year, isComment, lengthCategory, m_count
ORDER BY year DESC, isComment ASC, lengthCategory ASC;

@Dtenwolde Dtenwolde merged commit 518e219 into main Feb 6, 2024
5 of 23 checks passed
@Dtenwolde Dtenwolde deleted the 85-with-queries-lead-to-segmentation-fault branch February 6, 2024 12:44
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.

With queries lead to segmentation fault
1 participant