Skip to content

Commit

Permalink
Cleaning up implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
lct45 committed Jan 26, 2021
1 parent c175058 commit 5215e96
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ literal
;

nonReserved
: SHOW | COLUMNS | COLUMN | PARTITIONS | FUNCTIONS | FUNCTION | SESSION
: SHOW | TABLES | COLUMNS | COLUMN | PARTITIONS | FUNCTIONS | FUNCTION | SESSION
| STRUCT | MAP | ARRAY | PARTITION
| INTEGER | DATE | TIME | TIMESTAMP | INTERVAL | ZONE
| YEAR | MONTH | DAY | HOUR | MINUTE | SECOND
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,10 @@ public Node visitTerminateQuery(final SqlBaseParser.TerminateQueryContext contex

@Override
public Node visitShowColumns(final SqlBaseParser.ShowColumnsContext context) {
if (context.sourceName().identifier() instanceof SqlBaseParser.UnquotedIdentifierContext
&& context.sourceName().getText().equals("TABLES")) {
return new DescribeTables(getLocation(context), context.EXTENDED() != null);
}
return new ShowColumns(
getLocation(context),
ParserUtil.getSourceName(context.sourceName()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
import io.confluent.ksql.parser.tree.RegisterType;
import io.confluent.ksql.parser.tree.SelectItem;
import io.confluent.ksql.parser.tree.SetProperty;
import io.confluent.ksql.parser.tree.ShowColumns;
import io.confluent.ksql.parser.tree.SingleColumn;
import io.confluent.ksql.parser.tree.Statement;
import io.confluent.ksql.parser.tree.TableElement;
Expand Down

0 comments on commit 5215e96

Please sign in to comment.