Skip to content

SQL: Methods called on expand() return values are ignored #1004

Closed

Description

@gramian

ArcadeDB Version: ArcadeDB Server v23.3.1 (build da609e4/1680693032550/main)

JDK Version: Running on Mac OS X 12.6.4 - OpenJDK 64-Bit Server VM Homebrew

Methods that are called on the return value of expand() seem to be ignored (at least) in studio or console.

Expected behavior

"1", "2", "3", "4"

Actual behavior

1, 2, 3, 4

Steps to reproduce

SELECT expand([1,2,3,4]).asString()

the same seems to hold for other methods, too.

Activity

  1. lvca commented on Apr 5, 2023

    @lvca
    Member

    expand() is a special function different from all the others because able to change the return type. Have you tried with other functions as well?

  2. self-assigned this
    on Apr 5, 2023
  3. gramian commented on Apr 5, 2023

    @gramian
    CollaboratorAuthor

    I have tried various methods on top of expand, none have effect. I am fine with that given expand's special function, but it should be documented (before I wanted to make sure this is no bug), or maybe an error should be raised?

  4. lvca commented on Apr 5, 2023

    @lvca
    Member

    I think the documentation lacks such information. An exception should be thrown so the user has feedback on this invalid operation.

  5. added this to the 23.4.1 milestone on Apr 5, 2023
  6. gramian commented on Apr 5, 2023

    @gramian
    CollaboratorAuthor

    I will add to the documentation.

  7. gramian commented on Apr 5, 2023

    @gramian
    CollaboratorAuthor

    BTW, this:

    SELECT expand([{'name':2},2,3,4]).name
    

    produces a weird result, but an effect. Maybe all modifiers (method calls, array indexing and suffix identifiers) should be prohibited?

  8. lvca commented on Apr 5, 2023

    @lvca
    Member

    Fixed. Now any attempt to append something to the expand() projection (any modifier in the grammar) throws:

    throw new CommandSQLParsingException("Invalid modifier after special function expand()");
  9. gramian commented on Apr 15, 2023

    @gramian
    CollaboratorAuthor

    @lvca the functions intersect and unionall seem to have the same problem, I assume for the same reason as expand - being special. If so I could add notes to the docs and the error could be raised for those too, or is this a bug?

  10. lvca commented on Apr 17, 2023

    @lvca
    Member

    expand() is the only function very "special". Do you have a query that is not working?

  11. gramian commented on Apr 17, 2023

    @gramian
    CollaboratorAuthor

    see #1037

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions