GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Console LOAD command does not parse comments in OSQL script files correctly · Issue #1422 · ArcadeData/arcadedb

Console LOAD command does not parse comments in OSQL script files correctly #1422

New issue
Copy link
New issue
Copy link
Closed
Closed
Console LOAD command does not parse comments in OSQL script files correctly#1422
Copy link
Assignees
lvcagramian
Labels
wontfixThis will not be worked on
Milestone
24.11.1

Description

@ironluca
ironluca
opened on Jan 12, 2024
Issue body actions

client-platform-base-db-schema.txt
Parsing of comments from script files loaded with "load" command from 'console.sh' is not correct, it takes the comments as OSQL statements and generates exception (as highlighted below). The script part executes perfectly and creates the necessary vertex and edge types.

The above is not a show stopper as the script part executes fine.

`{test_db}> /*The vertex class that represents a generalized root or conceptual staring point of a graph
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation /*The vertex class that represents a generalized root or conceptual staring point of a graph (cause:com.arcadedb.query.sql.parser.TokenMgrError detail:Lexical error at line 1, column 93. Encountered: after : "")
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
at com.arcadedb.console.Console.executeSQL(Console.java:602)
at com.arcadedb.console.Console.execute(Console.java:273)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.interactiveMode(Console.java:131)
at com.arcadedb.console.Console.execute(Console.java:185)
at com.arcadedb.console.Console.main(Console.java:148)

{test_db}> (graphs don't have a starting point, this is just a conceptual start vertex for complete graph traversal).
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation (graphs don't have a starting point, this is just a conceptual start vertex for complete graph traversal). (cause:com.arcadedb.query.sql.parser.ParseException detail:Encountered "(" "(" at line 1, column 1. Was expecting one of: ... ... )
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
at com.arcadedb.console.Console.executeSQL(Console.java:602)
at com.arcadedb.console.Console.execute(Console.java:273)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.interactiveMode(Console.java:131)
at com.arcadedb.console.Console.execute(Console.java:185)
at com.arcadedb.console.Console.main(Console.java:148)

{test_db}>
{test_db}> Usually two objects of this class will be created, one sits at the top of the hierarchy of the
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation Usually two objects of this class will be created, one sits at the top of the hierarchy of the (cause:com.arcadedb.query.sql.parser.ParseException detail:Encountered "Usually" at line 1, column 1. Was expecting one of: ... ... )
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
at com.arcadedb.console.Console.executeSQL(Console.java:602)
at com.arcadedb.console.Console.execute(Console.java:273)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.interactiveMode(Console.java:131)
at com.arcadedb.console.Console.execute(Console.java:185)
at com.arcadedb.console.Console.main(Console.java:148)

{test_db}> ontology def model and another at the top of the hierarchy of the ontology data model.
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation ontology def model and another at the top of the hierarchy of the ontology data model. (cause:com.arcadedb.query.sql.parser.ParseException detail:Encountered "ontology" at line 1, column 1. Was expecting one of: ... ... )
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
at com.arcadedb.console.Console.executeSQL(Console.java:602)
at com.arcadedb.console.Console.execute(Console.java:273)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.interactiveMode(Console.java:131)
at com.arcadedb.console.Console.execute(Console.java:185)
at com.arcadedb.console.Console.main(Console.java:148)

{test_db}>
{test_db}> In addition, this class can be used by applications to declare conceptual application root vertices
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation In addition, this class can be used by applications to declare conceptual application root vertices (cause:com.arcadedb.query.sql.parser.ParseException detail:Encountered "In" at line 1, column 1. Was expecting one of: ... ... )
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
at com.arcadedb.console.Console.executeSQL(Console.java:602)
at com.arcadedb.console.Console.execute(Console.java:273)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.interactiveMode(Console.java:131)
at com.arcadedb.console.Console.execute(Console.java:185)
at com.arcadedb.console.Console.main(Console.java:148)

{test_db}> in the data model. The name property of this class are unique and cannot be repeated.
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation in the data model. The name property of this class are unique and cannot be repeated. (cause:com.arcadedb.query.sql.parser.ParseException detail:Encountered "in" at line 1, column 1. Was expecting one of: ... ... )
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
at com.arcadedb.console.Console.executeSQL(Console.java:602)
at com.arcadedb.console.Console.execute(Console.java:273)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.interactiveMode(Console.java:131)
at com.arcadedb.console.Console.execute(Console.java:185)
at com.arcadedb.console.Console.main(Console.java:148)

{test_db}> /
ERROR:
com.arcadedb.remote.RemoteException: Error on executing remote operation / (cause:com.arcadedb.query.sql.parser.ParseException detail:Encountered "" "
" at line 1, column 1. Was expecting one of: ... ... )
at com.arcadedb.remote.RemoteHttpComponent.manageException(RemoteHttpComponent.java:446)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:170)
at com.arcadedb.remote.RemoteDatabase.databaseCommand(RemoteDatabase.java:461)
at com.arcadedb.remote.RemoteDatabase.command(RemoteDatabase.java:408)
at com.arcadedb.console.Console.executeSQL(Console.java:602)
at com.arcadedb.console.Console.execute(Console.java:273)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.executeLoad(Console.java:699)
at com.arcadedb.console.Console.execute(Console.java:267)
at com.arcadedb.console.Console.parse(Console.java:742)
at com.arcadedb.console.Console.interactiveMode(Console.java:131)
at com.arcadedb.console.Console.execute(Console.java:185)
at com.arcadedb.console.Console.main(Console.java:148)

{test_db}> CREATE VERTEX TYPE GeneralizedInformationRoot IF NOT EXISTS
+---------+--------------------------+
|NAME |VALUE |
+---------+--------------------------+
|operation|create vertex type |
|typeName |GeneralizedInformationRoot|
+---------+--------------------------+
Command executed in 84ms
{test_db}>
{test_db}> CREATE PROPERTY GeneralizedInformationRoot.uniqueId IF NOT EXISTS STRING (MANDATORY TRUE, DEFAULT "uuid()", READONLY TRUE, NOTNULL TRUE)
+------------+--------------------------+
|NAME |VALUE |
+------------+--------------------------+
|operation |create property |
|typeName |GeneralizedInformationRoot|
|propertyName|uniqueId |
|MANDATORY |true |
|DEFAULT |uuid() |
|READONLY |true |
|NOTNULL |true |
+------------+--------------------------+
Command executed in 45ms
`

Actual behavior

<add here>

Steps to reproduce

<add here>

<An SQL script to reproduce the problem or a JUnit test case will increase **A LOT** the chance to have a quick fix>

Activity

Next
  1. gramian commented on Jan 12, 2024

    @gramian
    gramian
    on Jan 12, 2024
    Collaborator
    More actions

    Hi,
    The ArcadeDB console works line-by-line, so mulitline comments using /* ... */ do not work; for multiline comments each line needs to be started by -- . The same is true in general, meaning also SQL statements cannot span multiple lines.

  2. tmcsys commented on Jan 13, 2024

    @tmcsys
    tmcsys
    on Jan 13, 2024
    More actions

    Am I reading this issue correctly?

    Multiline comments ‘C’ and Java-type comments are fairly common in the SQL world. I was surprised to find that they did not work in ArcadeDB.

    Would be fairly trivial for a line-by-line parser. Stop parsing at /*; resume at */. ANTLR 101.

    Comments below are for PostgreSQL Comments.

    Syntax Using -- symbol

    The syntax for creating a SQL comment in PostgreSQL using -- symbol is:

    -- comment goes here
    In PostgreSQL, a comment started with -- symbol is similar to a comment starting with # symbol. When using the -- symbol, the comment must be at the end of a line in your SQL statement with a line break after it. This method of commenting can only span a single line within your SQL and must be at the end of the line.

    Syntax Using /* and */ symbols

    The syntax for creating a SQL comment in PostgreSQL using /* and */ symbols is:

    /* comment goes here */
    In PostgreSQL, a comment that starts with /** symbol and ends with */ and can be anywhere in your SQL statement. This method of commenting can span several lines within your SQL.

  3. lvca commented on Jan 14, 2024

    @lvca
    lvca
    on Jan 14, 2024
    Member
    More actions

    I see we support multi-line comments, but from the grammar, I see the starting sequence is /**. Check this:

    https://github.com/orientechnologies/orientdb/blob/34aa90e7970dd52c9937ddd87ee501e08bd75568/core/src/main/grammar/OrientSQL.jjt#L73

  4. lvca commented on Jan 14, 2024

    @lvca
    lvca
    on Jan 14, 2024
    Member
    More actions

    Just tried both and work from studio:

    /*
    This is a test
    */
    
    SELECT FROM Action
    
    /**
    This is a test
    */
    
    SELECT FROM Action
    
  5. gramian commented on Jan 14, 2024

    @gramian
    gramian
    on Jan 14, 2024
    Collaborator
    More actions

    I think the question was specifically about the console which AFAIK does not. I guess in a single line a /* ... */ would work as it would be handled by the query engine.

  6. lvca commented on Jan 14, 2024

    @lvca
    lvca
    on Jan 14, 2024
    Member
    More actions

    Ok, the issue with your script was with the create index command: ArcadeDB doesn't support hash indexes.

    Testing this works:

    /*The vertex class that represents a generalized root or conceptual staring point of a graph 
      (graphs don't have a starting point, this is just a conceptual start vertex for complete graph traversal).
      
      Usually two objects of this class will be created, one sits at the top of the hierarchy of the 
      ontology def model and another at the top of the hierarchy of the ontology data model.
      
      In addition, this class can be used by applications to declare conceptual application root vertices 
      in the data model. The name property of this class are unique and cannot be repeated.
    */
    
    CREATE VERTEX TYPE GeneralizedInformationRoot IF NOT EXISTS;
    
    CREATE PROPERTY GeneralizedInformationRoot.uniqueId IF NOT EXISTS STRING (MANDATORY TRUE, DEFAULT "uuid()", READONLY TRUE, NOTNULL TRUE);
    
    CREATE PROPERTY GeneralizedInformationRoot.creationTime IF NOT EXISTS LONG (MANDATORY TRUE, DEFAULT sysdate().asLong(), READONLY TRUE, NOTNULL TRUE);
    
    CREATE PROPERTY GeneralizedInformationRoot.name IF NOT EXISTS STRING (MANDATORY TRUE, READONLY TRUE, NOTNULL TRUE);
    
    
    /*Create the edge class that represents a generalized connection between vertices. This class is generally 
      used to connection GeneralizedInformationRoot to other non-root verices as a starting point
    */
    CREATE EDGE TYPE GeneralizedInformationConnection IF NOT EXISTS;
    
    CREATE PROPERTY GeneralizedInformationConnection.uniqueId IF NOT EXISTS STRING (MANDATORY TRUE, DEFAULT "uuid()", READONLY TRUE, NOTNULL TRUE);
    
    CREATE PROPERTY GeneralizedInformationConnection.creationTime IF NOT EXISTS LONG (MANDATORY TRUE, DEFAULT sysdate().asLong(), READONLY TRUE, NOTNULL TRUE);
    
  7. lvca
    closed this as completedon Jan 14, 2024
  8. lvca
    added
    invalidThis doesn't seem right
    on Jan 14, 2024
  9. lvca
    self-assigned this
    on Jan 14, 2024
  10. lvca
    added this to the 24.1.1 milestone on Jan 14, 2024
  11. lvca commented on Jan 14, 2024

    @lvca
    lvca
    on Jan 14, 2024
    Member
    More actions

    @gramian reports the issue is still present with the console, reopening it.

  12. lvca
    added
    bug
    and removed
    invalidThis doesn't seem right
    on Jan 14, 2024
  13. gramian
    reopened this on Jan 14, 2024
  14. gramian
    self-assigned this
    on Jan 22, 2024
  15. 7 remaining items

  16. lvca
    modified the milestones: 24.5.1, 24.6.1 on May 24, 2024
  17. lvca commented on Jun 24, 2024

    @lvca
    lvca
    on Jun 24, 2024
    Member
    More actions

    The console accepts additional commands, like exit, list databases, and more. I think it's safer to state only the comments that are accepted in the console.

  18. lvca
    modified the milestones: 24.6.1, 24.8.1 on Jul 23, 2024
  19. lvca
    modified the milestones: 24.10.1, 24.11.1 on Oct 12, 2024
  20. gramian commented on Nov 2, 2024

    @gramian
    gramian
    on Nov 2, 2024
    Collaborator
    More actions

    @lvca @robfrank This issue can be closed given multiline comments are not admissible in console. I can expand docu on this then. WDYT?

    Reacted by Luca Garulli
  21. lvca
    closed this as completedon Nov 3, 2024
  22. lvca
    added
    wontfixThis will not be worked on
    and removed
    bug
    on Nov 3, 2024
  23. mergify
    added a commit that references this issue on Sep 14, 2025

    chore(deps): bump jline.version from 3.30.5 to 3.30.6 [skip ci]

    dad3db5
  24. tae898
    added a commit that references this issue on Jun 28, 2026

    chore(deps): bump jline.version from 3.30.5 to 3.30.6 [skip ci]

    05a1acd
  25. mergify
    added 2 commits that reference this issue on Aug 9, 2026

    chore(deps-dev): bump testcontainers from 12.0.4 to 12.1.0 in /e2e-js…

    82fd973

    chore(deps-dev): bump testcontainers from 12.0.4 to 12.1.0 in /e2e-st…

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

Metadata

Metadata

Assignees

  • @gramian
    gramian
  • @lvca
    lvca

Labels

wontfixThis will not be worked on

Type

No type

Projects

No projects

    Milestone

    • 24.11.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.