korlov42 commented on code in PR #1025:
URL: https://github.com/apache/ignite-3/pull/1025#discussion_r953474111
##########
docs/_docs/sql-reference/ddl.adoc:
##########
@@ -245,6 +245,64 @@ Drop Person table if the one exists:
DROP TABLE IF EXISTS "Person";
----
+== CREATE INDEX
+
+Creates a new index.
+
+[source,sql]
+----
+CREATE INDEX [IF NOT EXISTS] name ON tableName
+[USING { HASH | TREE }]
+((tableColumn [, tableColumn]...) [ASC | DESC]
Review Comment:
Please stop mindlessly copy other schemas.
We can't use `tableColumn` for indexed column definitions, because they have
completely different structures. Besides, you've added an additional
parenthesis which made the schema invalid.
In fact, this schema should reflect the following syntax tree:
```
CREATE INDEX -- I want to create an index
|- optional IF NOT EXISTS -- I don't mind if someone have already
created such index
|- name -- I want the index to have name `name`
|- ON tableName -- This index should be built over the data of table
`tableName`
|- optional USING { HASH | TREE } -- I want the index to be built
with particular algorithm (hashing or sorting)
|- parenthesis -- Here I define which columns should be indexed
|- indexedColumnDefinition -- within parenthesis, such
definition might repeat several times
|- columnName -- I want the column from `tableName`
with name `columnName` to part of the index
|- optional ASC or DESC -- the order in which the
column should be sorted. For example, if there is a table with column ID having
values [3, 1, 2], then the index over this column will be looks like [1, 2, 3]
or [3, 2, 1]
|- optional NULLS { FIRST | LAST} -- where to place
NULL values: [null, null, 1, 2, 3] or [1, 2, 3, null, null]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]