Code review comment: Most of the operations has the same operands `new String[] { stmt };` can we merge the handling of them ?

Code before review:
private static Optional<SqlCommandCall> parseBySqlParser(Parser sqlParser, String stmt) {
List<Operation> operations;
try {
operations = sqlParser.parse(stmt);
} catch (Throwable e) {
if (e instanceof ValidationException) {
throw new SqlExecutionException("Invalidate SQL statement.", e);
}
return Optional.empty();
}
if (operations.size() != 1) {
throw new SqlExecutionException("Only single statement is supported now.");
}
final SqlCommand cmd;
String[] operands = new String[0];
Operation operation = operations.get(0);
if (operation instanceof CatalogSinkModifyOperation) {
boolean overwrite = ((CatalogSinkModifyOperation) operation).isOverwrite();
cmd = overwrite ? SqlCommand.INSERT_OVERWRITE : SqlCommand.INSERT_INTO;
operands = new String[] { stmt };
} else if (operation instanceof CreateTableOperation) {
cmd = SqlCommand.CREATE_TABLE;
operands = new String[] { stmt };
} else if (operation instanceof DropTableOperation) {
cmd = SqlCommand.DROP_TABLE;
operands = new String[] { stmt };
} else if (operation instanceof AlterTableOperation) {
cmd = SqlCommand.ALTER_TABLE;
operands = new String[] { stmt };
} else if (operation instanceof CreateViewOperation) {
cmd = SqlCommand.CREATE_VIEW;
CreateViewOperation op = (CreateViewOperation) operation;
operands = new String[] { op.getViewIdentifier().asSerializableString(),
op.getCatalogView().getOriginalQuery() };
} else if (operation instanceof DropViewOperation) {
cmd = SqlCommand.DROP_VIEW;
operands = new String[] { ((DropViewOperation) operation).getViewIdentifier().asSerializableString() };
} else if (operation instanceof CreateDatabaseOperation) {
cmd = SqlCommand.CREATE_DATABASE;
operands = new String[] { stmt };
} else if (operation instanceof DropDatabaseOperation) {
cmd = SqlCommand.DROP_DATABASE;
operands = new String[] { stmt };
} else if (operation instanceof AlterDatabaseOperation) {
cmd = SqlCommand.ALTER_DATABASE;
operands = new String[] { stmt };
} else if (operation instanceof CreateCatalogOperation) {
cmd = SqlCommand.CREATE_CATALOG;
operands = new String[] { stmt };
} else if (operation instanceof UseCatalogOperation) {
cmd = SqlCommand.USE_CATALOG;
operands = new String[] { String.format("`%s`", ((UseCatalogOperation) operation).getCatalogName()) };
} else if (operation instanceof UseDatabaseOperation) {
cmd = SqlCommand.USE;
UseDatabaseOperation op = ((UseDatabaseOperation) operation);
operands = new String[] { String.format("`%s`.`%s`", op.getCatalogName(), op.getDatabaseName()) };
} else if (operation instanceof ShowCatalogsOperation) {
cmd = SqlCommand.SHOW_CATALOGS;
} else if (operation instanceof ShowDatabasesOperation) {
cmd = SqlCommand.SHOW_DATABASES;
} else if (operation instanceof ShowTablesOperation) {
cmd = SqlCommand.SHOW_TABLES;
} else if (operation instanceof ShowFunctionsOperation) {
cmd = SqlCommand.SHOW_FUNCTIONS;
} else if (operation instanceof ExplainOperation) {
cmd = SqlCommand.EXPLAIN;
operands = new String[] { stmt };
} else if (operation instanceof DescribeTableOperation) {
cmd = SqlCommand.DESCRIBE;
operands = new String[] { ((DescribeTableOperation) operation).getSqlIdentifier().asSerializableString() };
} else if (operation instanceof QueryOperation) {
cmd = SqlCommand.SELECT;
operands = new String[] { stmt };
} else {
cmd = null;
}
if (cmd == null) {
return Optional.empty();
} else {
return Optional.of(new SqlCommandCall(cmd, operands));
}
}

Line under review: } else {

Code after addressing the review:
private static Optional<SqlCommandCall> parseBySqlParser(Parser sqlParser, String stmt) {
List<Operation> operations;
try {
operations = sqlParser.parse(stmt);
} catch (Throwable e) {
if (e instanceof ValidationException) {
throw new SqlExecutionException("Invalidate SQL statement.", e);
}
return Optional.empty();
}
if (operations.size() != 1) {
throw new SqlExecutionException("Only single statement is supported now.");
}
final SqlCommand cmd;
String[] operands = new String[] { stmt };
Operation operation = operations.get(0);
if (operation instanceof CatalogSinkModifyOperation) {
boolean overwrite = ((CatalogSinkModifyOperation) operation).isOverwrite();
cmd = overwrite ? SqlCommand.INSERT_OVERWRITE : SqlCommand.INSERT_INTO;
} else if (operation instanceof CreateTableOperation) {
cmd = SqlCommand.CREATE_TABLE;
} else if (operation instanceof DropTableOperation) {
cmd = SqlCommand.DROP_TABLE;
} else if (operation instanceof AlterTableOperation) {
cmd = SqlCommand.ALTER_TABLE;
} else if (operation instanceof CreateViewOperation) {
cmd = SqlCommand.CREATE_VIEW;
CreateViewOperation op = (CreateViewOperation) operation;
operands = new String[] { op.getViewIdentifier().asSerializableString(),
op.getCatalogView().getOriginalQuery() };
} else if (operation instanceof DropViewOperation) {
cmd = SqlCommand.DROP_VIEW;
operands = new String[] { ((DropViewOperation) operation).getViewIdentifier().asSerializableString() };
} else if (operation instanceof CreateDatabaseOperation) {
cmd = SqlCommand.CREATE_DATABASE;
} else if (operation instanceof DropDatabaseOperation) {
cmd = SqlCommand.DROP_DATABASE;
} else if (operation instanceof AlterDatabaseOperation) {
cmd = SqlCommand.ALTER_DATABASE;
} else if (operation instanceof CreateCatalogOperation) {
cmd = SqlCommand.CREATE_CATALOG;
} else if (operation instanceof DropCatalogOperation) {
cmd = SqlCommand.DROP_CATALOG;
} else if (operation instanceof UseCatalogOperation) {
cmd = SqlCommand.USE_CATALOG;
operands = new String[] { String.format("`%s`", ((UseCatalogOperation) operation).getCatalogName()) };
} else if (operation instanceof UseDatabaseOperation) {
cmd = SqlCommand.USE;
UseDatabaseOperation op = ((UseDatabaseOperation) operation);
operands = new String[] { String.format("`%s`.`%s`", op.getCatalogName(), op.getDatabaseName()) };
} else if (operation instanceof ShowCatalogsOperation) {
cmd = SqlCommand.SHOW_CATALOGS;
operands = new String[0];
} else if (operation instanceof ShowDatabasesOperation) {
cmd = SqlCommand.SHOW_DATABASES;
operands = new String[0];
} else if (operation instanceof ShowTablesOperation) {
cmd = SqlCommand.SHOW_TABLES;
operands = new String[0];
} else if (operation instanceof ShowFunctionsOperation) {
cmd = SqlCommand.SHOW_FUNCTIONS;
operands = new String[0];
} else if (operation instanceof CreateCatalogFunctionOperation ||
operation instanceof CreateTempSystemFunctionOperation) {
cmd = SqlCommand.CREATE_FUNCTION;
} else if (operation instanceof DropCatalogFunctionOperation ||
operation instanceof DropTempSystemFunctionOperation) {
cmd = SqlCommand.DROP_FUNCTION;
} else if (operation instanceof AlterCatalogFunctionOperation) {
cmd = SqlCommand.ALTER_FUNCTION;
} else if (operation instanceof ExplainOperation) {
cmd = SqlCommand.EXPLAIN;
} else if (operation instanceof DescribeTableOperation) {
cmd = SqlCommand.DESCRIBE;
operands = new String[] { ((DescribeTableOperation) operation).getSqlIdentifier().asSerializableString() };
} else if (operation instanceof QueryOperation) {
cmd = SqlCommand.SELECT;
} else {
cmd = null;
}
return cmd == null ? Optional.empty() : Optional.of(new SqlCommandCall(cmd, operands));
}