You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/07/26 20:28:00 UTC

[jira] [Commented] (ASTERIXDB-2934) Query fails with internal error

    [ https://issues.apache.org/jira/browse/ASTERIXDB-2934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17387613#comment-17387613 ] 

ASF subversion and git services commented on ASTERIXDB-2934:
------------------------------------------------------------

Commit 214ff55d2fcaecf8ac7dbfeea2faf1d0042f874c in asterixdb's branch refs/heads/master from Dmitry Lychagin
[ https://gitbox.apache.org/repos/asf?p=asterixdb.git;h=214ff55 ]

[ASTERIXDB-2934][COMP] GROUP BY requires FROM clause

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- If GROUP BY clause is present in SELECT
  block then FROM clause should be required
- Update grammar in the documentation
- Add testcases

Change-Id: I92f08c0639e19616de2dbaf70f0223d898e446b3
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/12464
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Dmitry Lychagin <dm...@couchbase.com>
Reviewed-by: Ali Alsuliman <al...@gmail.com>


> Query fails with internal error 
> --------------------------------
>
>                 Key: ASTERIXDB-2934
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2934
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: COMP - Compiler
>    Affects Versions: 0.9.6
>            Reporter: Dmitry Lychagin
>            Assignee: Dmitry Lychagin
>            Priority: Major
>             Fix For: 0.9.7
>
>
> The following query fails with NullPointerException at compile time.
> {noformat}
> SELECT x, y, COUNT(*) AS cnt
> GROUP BY ROLLUP(x, y);
> {noformat}
> Exception
> {noformat}
> java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "fieldList" is null
>         at org.apache.asterix.lang.sqlpp.visitor.DeepCopyVisitor.copyFieldList(DeepCopyVisitor.java:560) ~[classes/:?]
>         at org.apache.asterix.lang.sqlpp.visitor.DeepCopyVisitor.visit(DeepCopyVisitor.java:319) ~[classes/:?]
>         at org.apache.asterix.lang.sqlpp.visitor.DeepCopyVisitor.visit(DeepCopyVisitor.java:76) ~[classes/:?]
>         at org.apache.asterix.lang.common.clause.GroupbyClause.accept(GroupbyClause.java:109) ~[classes/:?]
>         at org.apache.asterix.lang.sqlpp.visitor.DeepCopyVisitor.visit(DeepCopyVisitor.java:171) ~[classes/:?]
>         at org.apache.asterix.lang.sqlpp.visitor.DeepCopyVisitor.visit(DeepCopyVisitor.java:76) ~[classes/:?]
>         at org.apache.asterix.lang.sqlpp.clause.SelectBlock.accept(SelectBlock.java:55) ~[classes/:?]
>         at org.apache.asterix.lang.sqlpp.util.SqlppRewriteUtil.deepCopy(SqlppRewriteUtil.java:60) ~[classes/:?]
>         at org.apache.asterix.lang.sqlpp.rewrites.visitor.SqlppGroupingSetsVisitor.rewriteMultipleGroupingSets(SqlppGroupingSetsVisitor.java:338) ~[classes/:?]
> {noformat}
> This query has SELECT clause with GROUP BY clause, but without FROM clause.
> This combination should not be allowed. If GROUP BY clause is present then FROM clause should be required. If FROM clause is absent then the only allowed clauses should be SELECT, LET and WHERE. i.e. SELECT ... LET ... WHERE ...



--
This message was sent by Atlassian Jira
(v8.3.4#803005)