Repository navigation
Description
Summary (three small items in the same family)
CreateMaterializedViewStatement.toString()emits aPERIODICkeyword the grammar does not
have, so the rendered statement is a syntax error. The sibling
AlterMaterializedViewStatement.toString()handles the samerefreshModecorrectly.Url.toString()prints the raw string, so a URL that arrived as a quotedSTRING_LITERAL
without a recognised scheme loses its quotes and the render no longer parses.- Twelve DDL statements have no
copy()override and throw
UnsupportedOperationException("IMPLEMENT copy() ON <X>");DropIndexStatement.copy()exists but
silently dropsifExists, andTraverseStatement.copy()dropsskip,
UpdateStatement.copy()dropsreturnCount.
Where (HEAD 417314c)
engine/src/main/java/com/arcadedb/query/sql/parser/CreateMaterializedViewStatement.java:89
if (refreshMode != null) {
sb.append(" REFRESH ").append(refreshMode); // refreshMode is "PERIODIC" (SQLASTBuilder:6675)
if ("PERIODIC".equalsIgnoreCase(refreshMode) && refreshInterval > 0)
sb.append(" EVERY ").append(refreshInterval).append(' ').append(refreshUnit);
}versus engine/src/main/java/com/arcadedb/query/sql/parser/AlterMaterializedViewStatement.java:82
sb.append(name).append(" REFRESH ");
if ("PERIODIC".equalsIgnoreCase(refreshMode) && refreshInterval > 0)
sb.append("EVERY ").append(refreshInterval).append(' ').append(refreshUnit);
else
sb.append(refreshMode);(grammar: materializedViewRefreshClause : REFRESH MANUAL | REFRESH INCREMENTAL | REFRESH EVERY INTEGER_LITERAL materializedViewTimeUnit - there is no PERIODIC token.)
engine/src/main/java/com/arcadedb/query/sql/parser/Url.java:37
public void toString(final Map<String, Object> params, final StringBuilder builder) {
builder.append(urlString);
}engine/src/main/java/com/arcadedb/query/sql/parser/DropIndexStatement.java (copy()) - no result.ifExists = ifExists;
Repro
$ java -cp ... RT corpus_raw.txt
REPARSE-FAIL | CREATE MATERIALIZED VIEW AlterPMView AS SELECT name FROM Account REFRESH EVERY 1 SECOND
render: CREATE MATERIALIZED VIEW AlterPMView AS SELECT name FROM Account REFRESH PERIODIC EVERY 1 SECOND
err: ... mismatched input 'PERIODIC' expecting {<EOF>, ';'}
REPARSE-FAIL | BACKUP DATABASE 'mybackup.zip'
render: BACKUP DATABASE mybackup.zip
err: ... mismatched input 'mybackup' expecting {<EOF>, ';'}
COPY-DIFF | DROP INDEX Foo IF EXISTS
orig: DROP INDEX Foo IF EXISTS
copy: DROP INDEX Foo
$ grep -A3 '^COPY-FAIL' out_raw.txt | grep '^COPY-FAIL' | sed 's/.*-> //' | sort | uniq -c | sort -rn
28 UnsupportedOperationException: IMPLEMENT copy() ON CheckDatabaseStatement
15 ... DropMaterializedViewStatement
14 ... CreateMaterializedViewStatement
14 ... CreateGraphAnalyticalViewStatement
12 ... DropGraphAnalyticalViewStatement
6 ... AlterMaterializedViewStatement
5 ... AlterGraphAnalyticalViewStatement
2 ... DropContinuousAggregateStatement
1 ... RefreshMaterializedViewStatement
1 ... RefreshContinuousAggregateStatement
1 ... RebuildGraphAnalyticalViewStatement
1 ... AlignDatabaseStatement
Suggested fix
- Use the
AlterMaterializedViewStatementshape (emitREFRESH EVERY n UNITfor PERIODIC). - Quote the URL in
Url.toString()when it is not one of the scheme-prefixed forms the lexer has a
token for (FILE_URL/HTTP_URL/HTTPS_URL/CLASSPATH_URL). - Add the missing
copy()overrides; addresult.ifExists = ifExists;toDropIndexStatement,
result.skip = ...toTraverseStatement,result.returnCount = returnCount;to
UpdateStatement.
Scope / confidence
Rated low because top-level Statement.copy() has no caller outside the parser package today
(verified by grep), so item 3 is latent; items 1 and 2 are live rendering defects but on statements
that are rarely re-rendered. The TraverseStatement/UpdateStatement gaps were found by a scripted
field-vs-copy()/getIdentityElements() diff over all 228 parser classes (script inline in the session
log); the remaining hits from that diff were constants and false positives, and the only substantive
ones outside this bundle are the AlterTypeStatement and CreateIndexStatement findings above.
Activity
Merge pull request #7813 from ArcadeData/fix/issues-7800-7799-7794-77…
lvca commentedon Sep 17, 2026
Fixed in #7813 (merged).
Two things:
CREATE MATERIALIZED VIEW ... REFRESH EVERY n SECOND/MINUTE/HOURnow prints back as valid SQL again (it used to print an extraPERIODICword that doesn't exist in the SQL grammar).BACKUP/EXPORT DATABASEwith a quoted file path (e.g.'my backup.zip') now keeps its quotes when the statement is re-rendered internally, instead of losing them.Also fixed several other DDL statements (materialized views, graph analytical views, continuous aggregates,
CHECK DATABASE,ALIGN DATABASE) that failed with an internal error when the engine needed to duplicate them internally (used for statement caching).❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Fix SQL parser re-render, copy() and LIMIT counting defects (ArcadeDa…
fix(engine,network,integration,grpcw): 5-issue batch - locale-safe DD…