Skip to content

Commit 5a4df80

Browse files
author
dssysolyatin
committed
Address comments
1 parent 0779153 commit 5a4df80

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

babel/src/main/java/org/apache/calcite/sql/babel/postgres/SqlSetOptions.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ public enum Names implements Symbolizable {
6767
*/
6868
public enum Values implements Symbolizable {
6969
NONE,
70-
LOCAL;
71-
72-
@Override public String toString() {
73-
return super.toString().replace("_", " ");
74-
}
70+
LOCAL
7571
}
7672
}

babel/src/test/java/org/apache/calcite/test/BabelParserTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,6 @@ private void checkParseInfixCast(String sqlType) {
392392
f.sql("SET timezone = 'PST8PDT'")
393393
.ok("SET \"timezone\" = 'PST8PDT'");
394394

395-
f.sql("SET SESSION AUTHORIZATION DEFAULT")
396-
.ok("SET \"session_authorization\" = DEFAULT");
397395
f.sql("SET SESSION AUTHORIZATION DEFAULT")
398396
.ok("SET \"session_authorization\" = DEFAULT");
399397

@@ -420,13 +418,17 @@ private void checkParseInfixCast(String sqlType) {
420418
@Test void testPostgresSqlReset() {
421419
SqlParserFixture f = fixture().withDialect(PostgresqlSqlDialect.DEFAULT);
422420

421+
/*
422+
* RESET ROLE, RESET SESSION AUTHORIZATION, RESET TRANSACTION ISOLATION LEVEL, and RESET TIME ZONE
423+
* are simply syntactic sugar for a more unified syntax RESET "<variable_name>".
424+
*/
423425
f.sql("RESET ALL").same();
424426
f.sql("RESET ROLE")
425427
.ok("RESET \"role\"");
426428
f.sql("RESET SESSION AUTHORIZATION")
427429
.ok("RESET \"session_authorization\"");
428-
f.sql("RESET SESSION AUTHORIZATION")
429-
.ok("RESET \"session_authorization\"");
430+
f.sql("RESET TRANSACTION ISOLATION LEVEL")
431+
.ok("RESET \"transaction_isolation\"");
430432
f.sql("RESET TIME ZONE")
431433
.ok("RESET \"timezone\"");
432434
f.sql("RESET autovacuum")

site/_docs/babel_reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ limitations under the License.
7777
}
7878
</style>
7979

80-
The page describes SQL expressions that are recognized by Calcite's babel SQL parser
81-
in addition to the expressions recognized by [Calcite's default SQL parser](reference.html).
80+
The page describes SQL statements and expressions that are recognized by Calcite's Babel SQL parser,
81+
in addition to those recognized by [Calcite's default SQL parser](reference.html).
8282

8383
## Grammar
8484

0 commit comments

Comments
 (0)