Skip to content

Commit

Permalink
feat: support show joblog xx (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
aceforeverd authored Oct 27, 2022
1 parent 7a01cae commit 96dca44
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions zetasql/parser/bison_parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ using zetasql::ASTDropStatement;
%token KW_ITERATE "ITERATE"
%token KW_ISOLATION "ISOLATION"
%token KW_JOB "JOB"
%token KW_JOBLOG "JOBLOG"
%token KW_JSON "JSON"
%token KW_KEY "KEY"
%token KW_LANGUAGE "LANGUAGE"
Expand Down Expand Up @@ -3620,6 +3621,10 @@ show_with_name_target:
{
$$ = parser->MakeIdentifier(@$, "JOB");
}
| "JOBLOG"
{
$$ = parser->MakeIdentifier(@$, "JOBLOG");
}
;

// a tiny wraper over expresion, used when a target comand requires an extra name
Expand Down Expand Up @@ -7503,6 +7508,7 @@ keyword_as_identifier:
| "ISOLATION"
| "ITERATE"
| "JOB"
| "JOBLOG"
| "JSON"
| "KEY"
| "LANGUAGE"
Expand Down
1 change: 1 addition & 0 deletions zetasql/parser/flex_tokenizer.l
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ invoker { return BisonParserImpl::token::KW_INVOKER; }
is { return BisonParserImpl::token::KW_IS; }
isolation { return BisonParserImpl::token::KW_ISOLATION; }
job { return BisonParserImpl::token::KW_JOB; }
joblog { return BisonParserImpl::token::KW_JOBLOG; }
join { return BisonParserImpl::token::KW_JOIN; }
json { return BisonParserImpl::token::KW_JSON; }
key { return BisonParserImpl::token::KW_KEY; }
Expand Down
1 change: 1 addition & 0 deletions zetasql/parser/keywords.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ constexpr KeywordInfoPOD kAllKeywords[] = {
{"is", KW_IS, KeywordInfo::kReserved},
{"isolation", KW_ISOLATION},
{"job", KW_JOB},
{"joblog", KW_JOBLOG},
{"join", KW_JOIN, KeywordInfo::kReserved},
{"json", KW_JSON},
{"key", KW_KEY},
Expand Down
10 changes: 10 additions & 0 deletions zetasql/parser/testdata/show.test
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ ShowStatement [0-9]
SHOW JOBS
==

show JOBLOG 19;
--
ShowStatement [0-14]
Identifier(JOBLOG) [5-11]
TargetName [12-14]
IntLiteral(19) [12-14]
--
SHOW JOBLOG 19
==

show VARIABLES;
--
ShowStatement [0-14]
Expand Down

0 comments on commit 96dca44

Please sign in to comment.