@Override protected Void visitShowCreate(ShowCreate node, Integer context) { if (node.getType() == ShowCreate.Type.TABLE) { builder.append("SHOW CREATE TABLE ") .append(formatName(node.getName())); } else if (node.getType() == ShowCreate.Type.VIEW) { builder.append("SHOW CREATE VIEW ") .append(formatName(node.getName())); } return null; }
@Override public Node visitShowCreateTable(SqlBaseParser.ShowCreateTableContext context) { return new ShowCreate(getLocation(context), ShowCreate.Type.TABLE, getQualifiedName(context.qualifiedName())); }
@Override protected Node visitShowCreate(ShowCreate node, Void context) QualifiedObjectName objectName = createQualifiedObjectName(session, node, node.getName()); Optional<ViewDefinition> viewDefinition = metadata.getView(session, objectName); if (node.getType() == VIEW) { if (!viewDefinition.isPresent()) { if (metadata.getTableHandle(session, objectName).isPresent()) { if (node.getType() == TABLE) { if (viewDefinition.isPresent()) { throw new SemanticException(NOT_SUPPORTED, node, "Relation '%s' is a view, not a table", objectName);
@Override public Node visitShowCreateView(SqlBaseParser.ShowCreateViewContext context) { return new ShowCreate(getLocation(context), ShowCreate.Type.VIEW, getQualifiedName(context.qualifiedName())); }
@Override protected Void visitShowCreate(ShowCreate node, Integer context) { if (node.getType() == ShowCreate.Type.TABLE) { builder.append("SHOW CREATE TABLE ") .append(formatName(node.getName())); } else if (node.getType() == ShowCreate.Type.VIEW) { builder.append("SHOW CREATE VIEW ") .append(formatName(node.getName())); } return null; }
@Override public Node visitShowCreateView(SqlBaseParser.ShowCreateViewContext context) { return new ShowCreate(getLocation(context), ShowCreate.Type.VIEW, getQualifiedName(context.qualifiedName())); }
@Override protected Void visitShowCreate(ShowCreate node, Integer context) { if (node.getType() == ShowCreate.Type.TABLE) { builder.append("SHOW CREATE TABLE ") .append(formatName(node.getName())); } else if (node.getType() == ShowCreate.Type.VIEW) { builder.append("SHOW CREATE VIEW ") .append(formatName(node.getName())); } return null; }
@Override public Node visitShowCreateTable(SqlBaseParser.ShowCreateTableContext context) { return new ShowCreate(getLocation(context), ShowCreate.Type.TABLE, getQualifiedName(context.qualifiedName())); }