Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.2 KB

comments.rst

File metadata and controls

57 lines (41 loc) · 1.2 KB

Comments

Table of contents

OpenSearch SQL supports ANSI SQL and MySQL style comments, including single-line comments or block comments across multiple lines. Both can be used on separate line(s) or within a SQL statement if needed.

A single-line comment starts with either # or --. All characters in the sequence to the end of the line are commented:

os> #comments
... SELECT
... -- comments
... 123; -- comments
fetched rows / total rows = 1/1
+-----+
| 123 |
|-----|
| 123 |
+-----+

Note that double-dash style requires at least one whitespace followed.

A block comment is enclosed within /* and */ across one or multiple lines. Nested comments are not supported:

os> /*
...  comment1
...  comment2
... */
... SELECT
... /* comments */
... 123;
fetched rows / total rows = 1/1
+-----+
| 123 |
|-----|
| 123 |
+-----+

Additionally, /*! ... */ is supported though ignored for now. This may be used to support optimization hints in future.