blob: f1a3cd86641c103e3a4ad12ff48243a13a8681c1 [file] [log] [blame]
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia Site Renderer 1.11.1 from org.apache.maven.plugins:maven-pmd-plugin:3.21.2:aggregate-cpd at 2024-04-21
| Rendered using Apache Maven Default Skin
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="generator" content="Apache Maven Doxia Site Renderer 1.11.1" />
<title>Apache ShardingSphere &#x2013; CPD Results</title>
<link rel="stylesheet" href="./css/maven-base.css" />
<link rel="stylesheet" href="./css/maven-theme.css" />
<link rel="stylesheet" href="./css/site.css" />
<link rel="stylesheet" href="./css/print.css" media="print" />
</head>
<body class="composite">
<div id="banner">
<div id="bannerLeft">Apache ShardingSphere
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<span id="publishDate">Last Published: 2024-04-21</span>
| <span id="projectVersion">Version: 5.4.2-SNAPSHOT</span>
</div>
<div class="xright"><a href="./" title="Apache ShardingSphere">Apache ShardingSphere</a> </div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>Modules</h5>
<ul>
<li class="none"><a href="shardingsphere-infra/index.html" title="shardingsphere-infra">shardingsphere-infra</a></li>
<li class="none"><a href="shardingsphere-parser/index.html" title="shardingsphere-parser">shardingsphere-parser</a></li>
<li class="none"><a href="shardingsphere-db-protocol/index.html" title="shardingsphere-db-protocol">shardingsphere-db-protocol</a></li>
<li class="none"><a href="shardingsphere-mode/index.html" title="shardingsphere-mode">shardingsphere-mode</a></li>
<li class="none"><a href="shardingsphere-kernel/index.html" title="shardingsphere-kernel">shardingsphere-kernel</a></li>
<li class="none"><a href="shardingsphere-jdbc/index.html" title="shardingsphere-jdbc">shardingsphere-jdbc</a></li>
<li class="none"><a href="shardingsphere-proxy/index.html" title="shardingsphere-proxy">shardingsphere-proxy</a></li>
<li class="none"><a href="shardingsphere-features/index.html" title="shardingsphere-features">shardingsphere-features</a></li>
<li class="none"><a href="shardingsphere-agent/index.html" title="shardingsphere-agent">shardingsphere-agent</a></li>
<li class="none"><a href="shardingsphere-test/index.html" title="shardingsphere-test">shardingsphere-test</a></li>
<li class="none"><a href="shardingsphere-distribution/index.html" title="shardingsphere-distribution">shardingsphere-distribution</a></li>
</ul>
<h5>Project Documentation</h5>
<ul>
<li class="collapsed"><a href="project-info.html" title="Project Information">Project Information</a></li>
<li class="expanded"><a href="project-reports.html" title="Project Reports">Project Reports</a>
<ul>
<li class="none"><a href="xref/index.html" title="Source Xref">Source Xref</a></li>
<li class="none"><a href="rat-report.html" title="Rat Report">Rat Report</a></li>
<li class="none"><a href="checkstyle-aggregate.html" title="Checkstyle">Checkstyle</a></li>
<li class="none"><strong>CPD</strong></li>
<li class="none"><a href="pmd.html" title="PMD">PMD</a></li>
<li class="none"><a href="taglist.html" title="Tag List">Tag List</a></li>
<li class="none"><a href="dependency-check-report.html" title="dependency-check">dependency-check</a></li>
</ul></li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<section>
<h2><a name="CPD_Results"></a>CPD Results</h2><a name="CPD_Results"></a>
<p>The following document contains the results of PMD's <a class="externalLink" href="https://pmd.github.io/latest/pmd_userdocs_cpd.html">CPD</a> 6.55.0.</p><section>
<h3><a name="Duplications"></a>Duplications</h3><a name="Duplications"></a>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L210">210</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L210">210</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public abstract class OpenGaussStatementVisitor extends OpenGaussStatementBaseVisitor&lt;ASTNode&gt; {
private final Collection&lt;ParameterMarkerSegment&gt; parameterMarkerSegments = new LinkedList&lt;&gt;();
@Override
public final ASTNode visitParameterMarker(final ParameterMarkerContext ctx) {
if (null == ctx.DOLLAR_()) {
return new ParameterMarkerValue(parameterMarkerSegments.size(), ParameterMarkerType.QUESTION);
}
return new ParameterMarkerValue(new NumberLiteralValue(ctx.NUMBER_().getText()).getValue().intValue() - 1, ParameterMarkerType.DOLLAR);
}
@Override
public final ASTNode visitNumberLiterals(final NumberLiteralsContext ctx) {
return new NumberLiteralValue(ctx.NUMBER_().getText());
}
@Override
public final ASTNode visitIdentifier(final IdentifierContext ctx) {
UnreservedWordContext unreservedWord = ctx.unreservedWord();
return null == unreservedWord ? new IdentifierValue(ctx.getText()) : visit(unreservedWord);
}
@Override
public final ASTNode visitUnreservedWord(final UnreservedWordContext ctx) {
return new IdentifierValue(ctx.getText());
}
@Override
public final ASTNode visitSchemaName(final SchemaNameContext ctx) {
return visit(ctx.identifier());
}
@Override
public final ASTNode visitTableName(final TableNameContext ctx) {
SimpleTableSegment result = new SimpleTableSegment(new TableNameSegment(ctx.name().getStart().getStartIndex(), ctx.name().getStop().getStopIndex(), (IdentifierValue) visit(ctx.name())));
OwnerContext owner = ctx.owner();
if (null != owner) {
result.setOwner(new OwnerSegment(owner.getStart().getStartIndex(), owner.getStop().getStopIndex(), (IdentifierValue) visit(owner.identifier())));
}
return result;
}
@Override
public final ASTNode visitColumnName(final ColumnNameContext ctx) {
ColumnSegment result = new ColumnSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), (IdentifierValue) visit(ctx.name()));
OwnerContext owner = ctx.owner();
if (null != owner) {
result.setOwner(new OwnerSegment(owner.getStart().getStartIndex(), owner.getStop().getStopIndex(), (IdentifierValue) visit(owner.identifier())));
}
return result;
}
@Override
public final ASTNode visitIndexName(final IndexNameContext ctx) {
IndexNameSegment indexName = new IndexNameSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), (IdentifierValue) visit(ctx.identifier()));
return new IndexSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), indexName);
}
@Override
public final ASTNode visitConstraintName(final ConstraintNameContext ctx) {
return new ConstraintSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), (IdentifierValue) visit(ctx.identifier()));
}
@Override
public final ASTNode visitTableNames(final TableNamesContext ctx) {
CollectionValue&lt;SimpleTableSegment&gt; result = new CollectionValue&lt;&gt;();
for (TableNameContext each : ctx.tableName()) {
result.getValue().add((SimpleTableSegment) visit(each));
}
return result;
}
@Override
public final ASTNode visitColumnNames(final ColumnNamesContext ctx) {
CollectionValue&lt;ColumnSegment&gt; result = new CollectionValue&lt;&gt;();
for (ColumnNameContext each : ctx.columnName()) {
result.getValue().add((ColumnSegment) visit(each));
}
return result;
}
@Override
public ASTNode visitAExpr(final AExprContext ctx) {
if (null != ctx.cExpr()) {
return visit(ctx.cExpr());
}
if (null != ctx.TYPE_CAST_()) {
return new TypeCastExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), ctx.getText(), (ExpressionSegment) visit(ctx.aExpr(0)), ctx.typeName().getText());
}
if (null != ctx.BETWEEN()) {
return createBetweenSegment(ctx);
}
if (null != ctx.IN()) {
return createInSegment(ctx);
}
if (null != ctx.patternMatchingOperator()) {
return createPatternMatchingOperationSegment(ctx);
}
Optional&lt;String&gt; binaryOperator = findBinaryOperator(ctx);
if (binaryOperator.isPresent()) {
return createBinaryOperationSegment(ctx, binaryOperator.get());
}
super.visitAExpr(ctx);
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new CommonExpressionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), text);
}
private Optional&lt;String&gt; findBinaryOperator(final AExprContext ctx) {
if (null != ctx.IS()) {
return Optional.of(ctx.IS().getText());
}
if (null != ctx.ISNULL()) {
return Optional.of(&quot;IS&quot;);
}
if (1 == ctx.aExpr().size()) {
return Optional.empty();
}
if (null != ctx.comparisonOperator()) {
return Optional.of(ctx.comparisonOperator().getText());
}
if (null != ctx.andOperator()) {
return Optional.of(ctx.andOperator().getText());
}
if (null != ctx.orOperator()) {
return Optional.of(ctx.orOperator().getText());
}
if (null != ctx.PLUS_()) {
return Optional.of(ctx.PLUS_().getText());
}
if (null != ctx.MINUS_()) {
return Optional.of(ctx.MINUS_().getText());
}
if (null != ctx.ASTERISK_()) {
return Optional.of(ctx.ASTERISK_().getText());
}
if (null != ctx.SLASH_()) {
return Optional.of(ctx.SLASH_().getText());
}
return Optional.empty();
}
private BinaryOperationExpression createPatternMatchingOperationSegment(final AExprContext ctx) {
String operator = getOriginalText(ctx.patternMatchingOperator()).toUpperCase();
ExpressionSegment left = (ExpressionSegment) visit(ctx.aExpr(0));
ListExpression right = new ListExpression(ctx.aExpr(1).start.getStartIndex(), ctx.aExpr().get(ctx.aExpr().size() - 1).stop.getStopIndex());
for (int i = 1; i &lt; ctx.aExpr().size(); i++) {
right.getItems().add((ExpressionSegment) visit(ctx.aExpr().get(i)));
}
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
private BinaryOperationExpression createBinaryOperationSegment(final AExprContext ctx, final String operator) {
if (&quot;IS&quot;.equalsIgnoreCase(operator)) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.aExpr(0));
String rightText;
ExpressionSegment right;
if (null != ctx.IS()) {
rightText = ctx.start.getInputStream().getText(new Interval(ctx.IS().getSymbol().getStopIndex() + 2, ctx.stop.getStopIndex())).trim();
right = new LiteralExpressionSegment(ctx.IS().getSymbol().getStopIndex() + 2, ctx.stop.getStopIndex(), rightText);
} else {
rightText = ctx.start.getInputStream().getText(new Interval(ctx.ISNULL().getSymbol().getStartIndex() + 2, ctx.stop.getStopIndex())).trim();
right = new LiteralExpressionSegment(ctx.ISNULL().getSymbol().getStartIndex() + 2, ctx.stop.getStopIndex(), rightText);
}
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, &quot;IS&quot;,
ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex())));
}
ExpressionSegment left = (ExpressionSegment) visit(ctx.aExpr(0));
ExpressionSegment right = (ExpressionSegment) visit(ctx.aExpr(1));
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
@Override
public ASTNode visitCExpr(final CExprContext ctx) {
if (null != ctx.columnref()) {
return visit(ctx.columnref());
}
if (null != ctx.parameterMarker()) {
ParameterMarkerValue parameterMarker = (ParameterMarkerValue) visit(ctx.parameterMarker());
ParameterMarkerExpressionSegment result = new ParameterMarkerExpressionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), parameterMarker.getValue(), parameterMarker.getType());
parameterMarkerSegments.add(result);
return result;
}
if (null != ctx.aexprConst()) {
return visit(ctx.aexprConst());
}
if (null != ctx.aExpr()) {
return visit(ctx.aExpr());
}
if (null != ctx.funcExpr()) {
return visit(ctx.funcExpr());
}
if (null != ctx.selectWithParens()) {
return createSubqueryExpressionSegment(ctx);
}
if (null != ctx.caseExpr()) {
return visit(ctx.caseExpr());
}
super.visitCExpr(ctx);
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new CommonExpressionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), text);
}
private ExpressionSegment createSubqueryExpressionSegment(final CExprContext ctx) {
SubquerySegment subquerySegment = new SubquerySegment(ctx.selectWithParens().getStart().getStartIndex(),
ctx.selectWithParens().getStop().getStopIndex(), (OpenGaussSelectStatement) visit(ctx.selectWithParens()), getOriginalText(ctx.selectWithParens()));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L1008">1008</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L975">975</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>result.setProjections(new ProjectionsSegment(-1, -1));
}
if (null != ctx.intoClause()) {
result.setIntoSegment((TableSegment) visit(ctx.intoClause()));
}
if (null != ctx.fromClause()) {
TableSegment tableSegment = (TableSegment) visit(ctx.fromClause());
result.setFrom(tableSegment);
}
if (null != ctx.whereClause()) {
result.setWhere((WhereSegment) visit(ctx.whereClause()));
}
if (null != ctx.groupClause()) {
result.setGroupBy((GroupBySegment) visit(ctx.groupClause()));
}
if (null != ctx.havingClause()) {
result.setHaving((HavingSegment) visit(ctx.havingClause()));
}
if (null != ctx.windowClause()) {
result.setWindow((WindowSegment) visit(ctx.windowClause()));
}
return result;
}
@Override
public ASTNode visitIntoClause(final IntoClauseContext ctx) {
return visit(ctx.optTempTableName().qualifiedName());
}
@Override
public ASTNode visitHavingClause(final HavingClauseContext ctx) {
ExpressionSegment expr = (ExpressionSegment) visit(ctx.aExpr());
return new HavingSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), expr);
}
@Override
public ASTNode visitWindowClause(final WindowClauseContext ctx) {
WindowSegment result = new WindowSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex());
appendWindowItems(ctx.windowDefinitionList(), result.getItemSegments());
return result;
}
private void appendWindowItems(final WindowDefinitionListContext ctx, final Collection&lt;WindowItemSegment&gt; windowItems) {
if (null != ctx.windowDefinitionList()) {
appendWindowItems(ctx.windowDefinitionList(), windowItems);
windowItems.add((WindowItemSegment) visit(ctx.windowDefinition()));
return;
}
windowItems.add((WindowItemSegment) visit(ctx.windowDefinition()));
}
@SuppressWarnings(&quot;unchecked&quot;)
@Override
public ASTNode visitWindowDefinition(final WindowDefinitionContext ctx) {
WindowItemSegment result = new WindowItemSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex());
result.setWindowName(new IdentifierValue(ctx.colId().getText()));
if (null != ctx.windowSpecification().partitionClause()) {
CollectionValue&lt;ExpressionSegment&gt; value = (CollectionValue&lt;ExpressionSegment&gt;) visit(ctx.windowSpecification().partitionClause().exprList());
result.setPartitionListSegments(value.getValue());
}
if (null != ctx.windowSpecification().sortClause()) {
OrderBySegment orderBySegment = (OrderBySegment) visit(ctx.windowSpecification().sortClause());
result.setOrderBySegment(orderBySegment);
}
if (null != ctx.windowSpecification().frameClause()) {
result.setFrameClause(new CommonExpressionSegment(ctx.windowSpecification().frameClause().start.getStartIndex(), ctx.windowSpecification().frameClause().stop.getStopIndex(),
ctx.windowSpecification().frameClause().getText()));
}
return result;
}
@Override
public ASTNode visitGroupClause(final GroupClauseContext ctx) {
Collection&lt;OrderByItemSegment&gt; items = new LinkedList&lt;&gt;();
for (GroupByItemContext each : ctx.groupByList().groupByItem()) {
items.add((OrderByItemSegment) visit(each));
}
return new GroupBySegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), items);
}
@Override
public ASTNode visitGroupByItem(final GroupByItemContext ctx) {
if (null != ctx.aExpr()) {
ASTNode astNode = visit(ctx.aExpr());
if (astNode instanceof ColumnSegment) {
return new ColumnOrderByItemSegment((ColumnSegment) astNode, OrderDirection.ASC, null);
}
if (astNode instanceof LiteralExpressionSegment) {
LiteralExpressionSegment index = (LiteralExpressionSegment) astNode;
return new IndexOrderByItemSegment(index.getStartIndex(), index.getStopIndex(),
Integer.parseInt(index.getLiterals().toString()), OrderDirection.ASC, null);
}
return new ExpressionOrderByItemSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(ctx), OrderDirection.ASC, null, (ExpressionSegment) visit(ctx.aExpr()));
}
return new ExpressionOrderByItemSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(ctx), OrderDirection.ASC, null);
}
@Override
public ASTNode visitTargetList(final TargetListContext ctx) {
ProjectionsSegment result = new ProjectionsSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
if (null != ctx.targetList()) {
ProjectionsSegment projections = (ProjectionsSegment) visit(ctx.targetList());
result.getProjections().addAll(projections.getProjections());
}
ProjectionSegment projection = (ProjectionSegment) visit(ctx.targetEl());
result.getProjections().add(projection);
return result;
}
@Override
public ASTNode visitTargetEl(final TargetElContext ctx) {
ProjectionSegment result = createProjectionSegment(ctx, ctx.aExpr());
if (null != ctx.identifier()) {
((AliasAvailable) result).setAlias(new AliasSegment(ctx.identifier().start.getStartIndex(), ctx.identifier().stop.getStopIndex(), new IdentifierValue(ctx.identifier().getText())));
}
return result;
}
private ProjectionSegment createProjectionSegment(final TargetElContext ctx, final AExprContext expr) {
if (null != ctx.ASTERISK_()) {
return new ShorthandProjectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
}
if (null != ctx.DOT_ASTERISK_()) {
ShorthandProjectionSegment result = new ShorthandProjectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setOwner(new OwnerSegment(ctx.colId().start.getStartIndex(), ctx.colId().stop.getStopIndex(), new IdentifierValue(ctx.colId().getText())));
return result;
}
if (null != ctx.aExpr()) {
ASTNode projection = visit(ctx.aExpr());
return createProjectionSegment(ctx, expr, projection);
}
return new ExpressionProjectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(expr), null);
}
private ProjectionSegment createProjectionSegment(final TargetElContext ctx, final AExprContext expr, final ASTNode projection) {
if (projection instanceof ColumnSegment) {
return new ColumnProjectionSegment((ColumnSegment) projection);
}
if (projection instanceof AggregationProjectionSegment) {
return (AggregationProjectionSegment) projection;
}
if (projection instanceof SubqueryExpressionSegment) {
SubqueryExpressionSegment subqueryExpression = (SubqueryExpressionSegment) projection;
String text = ctx.start.getInputStream().getText(new Interval(subqueryExpression.getStartIndex(), subqueryExpression.getStopIndex()));
return new SubqueryProjectionSegment(subqueryExpression.getSubquery(), text);
}
if (projection instanceof ExistsSubqueryExpression) {
ExistsSubqueryExpression existsSubqueryExpression = (ExistsSubqueryExpression) projection;
String text = ctx.start.getInputStream().getText(new Interval(existsSubqueryExpression.getStartIndex(), existsSubqueryExpression.getStopIndex()));
return new SubqueryProjectionSegment(existsSubqueryExpression.getSubquery(), text);
}
if (projection instanceof ExpressionSegment) {
return new ExpressionProjectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(expr), (ExpressionSegment) projection);
}
return new ExpressionProjectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(expr), null);
}
@Override
public ASTNode visitFromClause(final FromClauseContext ctx) {
return visit(ctx.fromList());
}
@Override
public ASTNode visitFromList(final FromListContext ctx) {
if (null != ctx.fromList()) {
JoinTableSegment result = new JoinTableSegment();
result.setStartIndex(ctx.start.getStartIndex());
result.setStopIndex(ctx.stop.getStopIndex());
result.setLeft((TableSegment) visit(ctx.fromList()));
result.setRight((TableSegment) visit(ctx.tableReference()));
result.setJoinType(JoinType.COMMA.name());
return result;
}
return visit(ctx.tableReference());
}
@Override
public ASTNode visitTableReference(final TableReferenceContext ctx) {
if (null != ctx.relationExpr()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L540">540</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L540">540</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussSelectStatement select = (OpenGaussSelectStatement) visit(ctx.selectWithParens());
SubquerySegment subquerySegment = new SubquerySegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), select, getOriginalText(ctx.selectWithParens()));
return new SubqueryExpressionSegment(subquerySegment);
}
ListExpression result = new ListExpression(ctx.LP_().getSymbol().getStartIndex(), ctx.RP_().getSymbol().getStopIndex());
result.getItems().addAll(((CollectionValue&lt;ExpressionSegment&gt;) visit(ctx.exprList())).getValue());
return result;
}
@SuppressWarnings(&quot;unchecked&quot;)
@Override
public ASTNode visitExprList(final ExprListContext ctx) {
CollectionValue&lt;ExpressionSegment&gt; result = new CollectionValue&lt;&gt;();
if (null != ctx.exprList()) {
result.combine((CollectionValue&lt;ExpressionSegment&gt;) visitExprList(ctx.exprList()));
}
result.getValue().add((ExpressionSegment) visit(ctx.aExpr()));
return result;
}
private BetweenExpression createBetweenSegment(final AExprContext ctx) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.aExpr(0));
ExpressionSegment between = (ExpressionSegment) visit(ctx.bExpr());
ExpressionSegment and = (ExpressionSegment) visit(ctx.aExpr(1));
boolean not = null != ctx.NOT();
return new BetweenExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, between, and, not);
}
@Override
public ASTNode visitBExpr(final BExprContext ctx) {
if (null != ctx.cExpr()) {
return visit(ctx.cExpr());
}
if (null != ctx.TYPE_CAST_()) {
return new TypeCastExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), ctx.getText(), (ExpressionSegment) visit(ctx.bExpr(0)), ctx.typeName().getText());
}
if (null != ctx.qualOp()) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.bExpr(0));
ExpressionSegment right = (ExpressionSegment) visit(ctx.bExpr(1));
String operator = ctx.qualOp().getText();
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
for (BExprContext each : ctx.bExpr()) {
visit(each);
}
return new LiteralExpressionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), ctx.getText());
}
private ProjectionSegment createAggregationSegment(final FuncApplicationContext ctx, final String aggregationType, final Collection&lt;ExpressionSegment&gt; expressionSegments) {
AggregationType type = AggregationType.valueOf(aggregationType.toUpperCase());
if (null == ctx.DISTINCT()) {
AggregationProjectionSegment result = new AggregationProjectionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), type, getOriginalText(ctx));
result.getParameters().addAll(expressionSegments);
return result;
}
AggregationDistinctProjectionSegment result =
new AggregationDistinctProjectionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), type, getOriginalText(ctx), getDistinctExpression(ctx));
result.getParameters().addAll(expressionSegments);
return result;
}
private String getDistinctExpression(final FuncApplicationContext ctx) {
StringBuilder result = new StringBuilder();
result.append(ctx.funcArgList().getText());
if (null != ctx.sortClause()) {
result.append(ctx.sortClause().getText());
}
return result.toString();
}
@Override
public final ASTNode visitDataTypeName(final DataTypeNameContext ctx) {
IdentifierContext identifierContext = ctx.identifier();
if (null != identifierContext) {
return new KeywordValue(identifierContext.getText());
}
Collection&lt;String&gt; dataTypeNames = new LinkedList&lt;&gt;();
for (int i = 0; i &lt; ctx.getChildCount(); i++) {
dataTypeNames.add(ctx.getChild(i).getText());
}
return new KeywordValue(String.join(&quot; &quot;, dataTypeNames));
}
@Override
public final ASTNode visitSortClause(final SortClauseContext ctx) {
Collection&lt;OrderByItemSegment&gt; items = new LinkedList&lt;&gt;();
for (SortbyContext each : ctx.sortbyList().sortby()) {
items.add((OrderByItemSegment) visit(each));
}
return new OrderBySegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), items);
}
@Override
public final ASTNode visitSortby(final SortbyContext ctx) {
OrderDirection orderDirection = null == ctx.ascDesc() ? OrderDirection.ASC : generateOrderDirection(ctx.ascDesc());
NullsOrderType nullsOrderType = generateNullsOrderType(ctx.nullsOrder());
ASTNode expr = visit(ctx.aExpr());
if (expr instanceof ColumnSegment) {
ColumnSegment column = (ColumnSegment) expr;
return new ColumnOrderByItemSegment(column, orderDirection, nullsOrderType);
}
if (expr instanceof LiteralExpressionSegment) {
LiteralExpressionSegment index = (LiteralExpressionSegment) expr;
return new IndexOrderByItemSegment(index.getStartIndex(), index.getStopIndex(), Integer.parseInt(index.getLiterals().toString()), orderDirection, nullsOrderType);
}
if (expr instanceof ExpressionSegment) {
return new ExpressionOrderByItemSegment(ctx.aExpr().getStart().getStartIndex(),
ctx.aExpr().getStop().getStopIndex(), getOriginalText(ctx.aExpr()), orderDirection, nullsOrderType, (ExpressionSegment) expr);
}
return new ExpressionOrderByItemSegment(ctx.aExpr().getStart().getStartIndex(), ctx.aExpr().getStop().getStopIndex(), getOriginalText(ctx.aExpr()), orderDirection, nullsOrderType);
}
private NullsOrderType generateNullsOrderType(final NullsOrderContext ctx) {
if (null == ctx) {
return null;
}
return null == ctx.FIRST() ? NullsOrderType.LAST : NullsOrderType.FIRST;
}
private OrderDirection generateOrderDirection(final AscDescContext ctx) {
return null == ctx.DESC() ? OrderDirection.ASC : OrderDirection.DESC;
}
@Override
public final ASTNode visitDataType(final DataTypeContext ctx) {
DataTypeSegment result = new DataTypeSegment();
result.setDataTypeName(((KeywordValue) visit(ctx.dataTypeName())).getValue());
result.setStartIndex(ctx.start.getStartIndex());
result.setStopIndex(ctx.stop.getStopIndex());
if (null != ctx.dataTypeLength()) {
DataTypeLengthSegment dataTypeLengthSegment = (DataTypeLengthSegment) visit(ctx.dataTypeLength());
result.setDataLength(dataTypeLengthSegment);
}
return result;
}
@Override
public final ASTNode visitDataTypeLength(final DataTypeLengthContext ctx) {
DataTypeLengthSegment result = new DataTypeLengthSegment();
result.setStartIndex(ctx.start.getStartIndex());
result.setStopIndex(ctx.stop.getStartIndex());
List&lt;TerminalNode&gt; numbers = ctx.NUMBER_();
if (1 == numbers.size()) {
result.setPrecision(Integer.parseInt(numbers.get(0).getText()));
}
if (2 == numbers.size()) {
result.setPrecision(Integer.parseInt(numbers.get(0).getText()));
result.setScale(Integer.parseInt(numbers.get(1).getText()));
}
return result;
}
@Override
public ASTNode visitInsert(final InsertContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L417">417</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L417">417</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>ctx.selectWithParens().getStop().getStopIndex(), (OpenGaussSelectStatement) visit(ctx.selectWithParens()), getOriginalText(ctx.selectWithParens()));
if (null != ctx.EXISTS()) {
subquerySegment.setSubqueryType(SubqueryType.EXISTS_SUBQUERY);
return new ExistsSubqueryExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), subquerySegment);
}
return new SubqueryExpressionSegment(subquerySegment);
}
@Override
public ASTNode visitCaseExpr(final CaseExprContext ctx) {
Collection&lt;ExpressionSegment&gt; whenExprs = new LinkedList&lt;&gt;();
Collection&lt;ExpressionSegment&gt; thenExprs = new LinkedList&lt;&gt;();
for (WhenClauseContext each : ctx.whenClauseList().whenClause()) {
whenExprs.add((ExpressionSegment) visit(each.aExpr(0)));
thenExprs.add((ExpressionSegment) visit(each.aExpr(1)));
}
ExpressionSegment caseExpr = null == ctx.caseArg() ? null : (ExpressionSegment) visit(ctx.caseArg().aExpr());
ExpressionSegment elseExpr = null == ctx.caseDefault() ? null : (ExpressionSegment) visit(ctx.caseDefault().aExpr());
return new CaseWhenExpression(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), caseExpr, whenExprs, thenExprs, elseExpr);
}
@Override
public ASTNode visitFuncExpr(final FuncExprContext ctx) {
if (null != ctx.functionExprCommonSubexpr()) {
return visit(ctx.functionExprCommonSubexpr());
}
Collection&lt;ExpressionSegment&gt; expressionSegments = getExpressionSegments(getTargetRuleContextFromParseTree(ctx, AExprContext.class));
// TODO replace aggregation segment
String aggregationType = ctx.funcApplication().funcName().getText();
if (AggregationType.isAggregationType(aggregationType)) {
return createAggregationSegment(ctx.funcApplication(), aggregationType, expressionSegments);
}
FunctionSegment result = new FunctionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ctx.funcApplication().funcName().getText(), getOriginalText(ctx));
result.getParameters().addAll(expressionSegments);
return result;
}
@Override
public ASTNode visitFunctionExprCommonSubexpr(final FunctionExprCommonSubexprContext ctx) {
if (null != ctx.CAST()) {
return new TypeCastExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), ctx.getText(), (ExpressionSegment) visit(ctx.aExpr(0)), ctx.typeName().getText());
}
FunctionSegment result = new FunctionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ctx.getChild(0).getText(), getOriginalText(ctx));
Collection&lt;ExpressionSegment&gt; expressionSegments = getExpressionSegments(getTargetRuleContextFromParseTree(ctx, AExprContext.class));
if (&quot;EXTRACT&quot;.equalsIgnoreCase(ctx.getChild(0).getText())) {
result.getParameters().add((ExpressionSegment) visit(getTargetRuleContextFromParseTree(ctx, ExtractArgContext.class).iterator().next()));
}
result.getParameters().addAll(expressionSegments);
return result;
}
@Override
public ASTNode visitExtractArg(final ExtractArgContext ctx) {
return new ExtractArgExpression(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ctx.getChild(0).getText());
}
private &lt;T extends ParseTree&gt; Collection&lt;T&gt; getTargetRuleContextFromParseTree(final ParseTree parseTree, final Class&lt;? extends T&gt; clazz) {
Collection&lt;T&gt; result = new LinkedList&lt;&gt;();
for (int index = 0; index &lt; parseTree.getChildCount(); index++) {
ParseTree child = parseTree.getChild(index);
if (clazz.isInstance(child)) {
result.add(clazz.cast(child));
} else {
result.addAll(getTargetRuleContextFromParseTree(child, clazz));
}
}
return result;
}
private Collection&lt;ExpressionSegment&gt; getExpressionSegments(final Collection&lt;AExprContext&gt; aExprContexts) {
Collection&lt;ExpressionSegment&gt; result = new LinkedList&lt;&gt;();
for (AExprContext each : aExprContexts) {
result.add((ExpressionSegment) visit(each));
}
return result;
}
@Override
public ASTNode visitAexprConst(final AexprConstContext ctx) {
LiteralValue&lt;?&gt; value;
if (null != ctx.numberConst()) {
value = new NumberLiteralValue(ctx.numberConst().getText());
} else if (null != ctx.STRING_()) {
value = new StringLiteralValue(ctx.STRING_().getText());
} else if (null != ctx.FALSE()) {
value = new BooleanLiteralValue(ctx.FALSE().getText());
} else if (null != ctx.TRUE()) {
value = new BooleanLiteralValue(ctx.TRUE().getText());
} else if (null != ctx.NULL()) {
value = new NullLiteralValue(ctx.getText());
} else {
value = new OtherLiteralValue(ctx.getText());
}
if (null != ctx.constTypeName() || null != ctx.funcName() &amp;&amp; null == ctx.LP_()) {
LiteralExpressionSegment expression = new LiteralExpressionSegment(ctx.STRING_().getSymbol().getStartIndex(), ctx.STRING_().getSymbol().getStopIndex(), value.getValue().toString());
String dataType = null == ctx.constTypeName() ? ctx.funcName().getText() : ctx.constTypeName().getText();
return new TypeCastExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), ctx.getText(), expression, dataType);
}
return SQLUtils.createLiteralExpression(value, ctx.start.getStartIndex(), ctx.stop.getStopIndex(), ctx.getText());
}
@Override
public ASTNode visitColumnref(final ColumnrefContext ctx) {
if (null != ctx.indirection()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L1280">1280</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L1235">1235</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return JoinType.INNER.name();
}
private JoinTableSegment visitJoinQual(final JoinQualContext ctx, final JoinTableSegment joinTableSource) {
if (null != ctx.aExpr()) {
ExpressionSegment condition = (ExpressionSegment) visit(ctx.aExpr());
joinTableSource.setCondition(condition);
}
if (null != ctx.USING()) {
joinTableSource.setUsing(generateUsingColumn(ctx.nameList()));
}
return joinTableSource;
}
private List&lt;ColumnSegment&gt; generateUsingColumn(final NameListContext ctx) {
List&lt;ColumnSegment&gt; result = new ArrayList&lt;&gt;();
if (null != ctx.nameList()) {
result.addAll(generateUsingColumn(ctx.nameList()));
}
if (null != ctx.name()) {
result.add(new ColumnSegment(ctx.name().start.getStartIndex(), ctx.name().stop.getStopIndex(), new IdentifierValue(ctx.name().getText())));
}
return result;
}
@Override
public ASTNode visitAliasClause(final AliasClauseContext ctx) {
StringBuilder aliasName = new StringBuilder(ctx.colId().getText());
if (null != ctx.nameList()) {
aliasName.append(ctx.LP_().getText());
aliasName.append(ctx.nameList().getText());
aliasName.append(ctx.RP_().getText());
}
return new AliasSegment(ctx.colId().start.getStartIndex(), ctx.stop.getStopIndex(), new IdentifierValue(aliasName.toString()));
}
private OwnerSegment createTableOwner(final IndirectionContext ctx) {
AttrNameContext attrName = ctx.indirectionEl().attrName();
return new OwnerSegment(attrName.start.getStartIndex(), attrName.stop.getStopIndex(), new IdentifierValue(attrName.getText()));
}
@Override
public ASTNode visitWhereClause(final WhereClauseContext ctx) {
ExpressionSegment expr = (ExpressionSegment) visit(ctx.aExpr());
return new WhereSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), expr);
}
@Override
public ASTNode visitSelectLimit(final SelectLimitContext ctx) {
if (null != ctx.limitClause() &amp;&amp; null != ctx.offsetClause()) {
return createLimitSegmentWhenLimitAndOffset(ctx);
}
return createLimitSegmentWhenRowCountOrOffsetAbsent(ctx);
}
@Override
public ASTNode visitSelectLimitValue(final SelectLimitValueContext ctx) {
if (null != ctx.ALL()) {
return null;
}
ASTNode astNode = visit(ctx.cExpr());
if (astNode instanceof ParameterMarkerExpressionSegment) {
return new ParameterMarkerLimitValueSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ((ParameterMarkerExpressionSegment) astNode).getParameterMarkerIndex());
}
return new NumberLiteralLimitValueSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), Long.parseLong(((LiteralExpressionSegment) astNode).getLiterals().toString()));
}
@Override
public ASTNode visitSelectOffsetValue(final SelectOffsetValueContext ctx) {
ASTNode astNode = visit(ctx.cExpr());
if (astNode instanceof ParameterMarkerExpressionSegment) {
return new ParameterMarkerLimitValueSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ((ParameterMarkerExpressionSegment) astNode).getParameterMarkerIndex());
}
return new NumberLiteralLimitValueSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), Long.parseLong(((LiteralExpressionSegment) astNode).getLiterals().toString()));
}
@Override
public ASTNode visitSelectFetchValue(final SelectFetchValueContext ctx) {
ASTNode astNode = visit(ctx.cExpr());
if (astNode instanceof ParameterMarkerExpressionSegment) {
return new ParameterMarkerLimitValueSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ((ParameterMarkerExpressionSegment) astNode).getParameterMarkerIndex());
}
return new NumberLiteralLimitValueSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), Long.parseLong(((LiteralExpressionSegment) astNode).getLiterals().toString()));
}
private LimitSegment createLimitSegmentWhenLimitAndOffset(final SelectLimitContext ctx) {
ParseTree astNode0 = ctx.getChild(0);
LimitValueSegment rowCount = null;
LimitValueSegment offset = null;
if (astNode0 instanceof LimitClauseContext) {
rowCount = null == ctx.limitClause().selectLimitValue() ? null : (LimitValueSegment) visit(ctx.limitClause().selectLimitValue());
} else {
offset = (LimitValueSegment) visit(ctx.offsetClause().selectOffsetValue());
}
ParseTree astNode1 = ctx.getChild(1);
if (astNode1 instanceof LimitClauseContext) {
rowCount = null == ctx.limitClause().selectLimitValue() ? null : (LimitValueSegment) visit(ctx.limitClause().selectLimitValue());
} else {
offset = (LimitValueSegment) visit(ctx.offsetClause().selectOffsetValue());
}
return new LimitSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), offset, rowCount);
}
private LimitSegment createLimitSegmentWhenRowCountOrOffsetAbsent(final SelectLimitContext ctx) {
if (null != ctx.limitClause()) {
if (null != ctx.limitClause().selectOffsetValue()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L241">241</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L440">440</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return createBinaryOperationExpression(ctx, ctx.orOperator().getText());
}
return new NotExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), (ExpressionSegment) visit(ctx.expr(0)), false);
}
private ASTNode createBinaryOperationExpression(final ExprContext ctx, final String operator) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.expr(0));
ExpressionSegment right = (ExpressionSegment) visit(ctx.expr(1));
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
@Override
public final ASTNode visitBooleanPrimary(final BooleanPrimaryContext ctx) {
if (null != ctx.IS()) {
String rightText = &quot;&quot;;
if (null != ctx.NOT()) {
rightText = rightText.concat(ctx.start.getInputStream().getText(new Interval(ctx.NOT().getSymbol().getStartIndex(),
ctx.NOT().getSymbol().getStopIndex()))).concat(&quot; &quot;);
}
Token operatorToken = null;
if (null != ctx.NULL()) {
operatorToken = ctx.NULL().getSymbol();
}
if (null != ctx.TRUE()) {
operatorToken = ctx.TRUE().getSymbol();
}
if (null != ctx.FALSE()) {
operatorToken = ctx.FALSE().getSymbol();
}
int startIndex = null == operatorToken ? ctx.IS().getSymbol().getStopIndex() + 2 : operatorToken.getStartIndex();
rightText = rightText.concat(ctx.start.getInputStream().getText(new Interval(startIndex, ctx.stop.getStopIndex())));
ExpressionSegment right = new LiteralExpressionSegment(ctx.IS().getSymbol().getStopIndex() + 2, ctx.stop.getStopIndex(), rightText);
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
ExpressionSegment left = (ExpressionSegment) visit(ctx.booleanPrimary());
String operator = &quot;IS&quot;;
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
if (null != ctx.comparisonOperator() || null != ctx.SAFE_EQ_()) {
return createCompareSegment(ctx);
}
return visit(ctx.predicate());
}
private ASTNode createCompareSegment(final BooleanPrimaryContext ctx) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.booleanPrimary());
ExpressionSegment right;
if (null != ctx.predicate()) {
right = (ExpressionSegment) visit(ctx.predicate());
} else {
right = (ExpressionSegment) visit(ctx.subquery());
}
String operator = null == ctx.SAFE_EQ_() ? ctx.comparisonOperator().getText() : ctx.SAFE_EQ_().getText();
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
@Override
public final ASTNode visitPredicate(final PredicateContext ctx) {
if (null != ctx.IN()) {
return createInSegment(ctx);
}
if (null != ctx.BETWEEN()) {
return createBetweenSegment(ctx);
}
if (null != ctx.LIKE()) {
return createBinaryOperationExpressionFromLike(ctx);
}
return visit(ctx.bitExpr(0));
}
private BinaryOperationExpression createBinaryOperationExpressionFromLike(final PredicateContext ctx) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.bitExpr(0));
ListExpression right = new ListExpression(ctx.simpleExpr(0).start.getStartIndex(), ctx.simpleExpr().get(ctx.simpleExpr().size() - 1).stop.getStopIndex());
for (SimpleExprContext each : ctx.simpleExpr()) {
right.getItems().add((ExpressionSegment) visit(each));
}
String operator = null == ctx.NOT() ? &quot;LIKE&quot; : &quot;NOT LIKE&quot;;
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
private InExpression createInSegment(final PredicateContext ctx) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.bitExpr(0));
ExpressionSegment right;
if (null != ctx.subquery()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L419">419</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L532">532</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return new OpenGaussAlterDomainStatement();
}
@Override
public ASTNode visitRenameTableSpecification(final RenameTableSpecificationContext ctx) {
RenameTableDefinitionSegment result = new RenameTableDefinitionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
TableNameSegment tableName = new TableNameSegment(ctx.identifier().start.getStartIndex(), ctx.identifier().stop.getStopIndex(), (IdentifierValue) visit(ctx.identifier()));
result.setRenameTable(new SimpleTableSegment(tableName));
return result;
}
@Override
public ASTNode visitAddColumnSpecification(final AddColumnSpecificationContext ctx) {
CollectionValue&lt;AddColumnDefinitionSegment&gt; result = new CollectionValue&lt;&gt;();
ColumnDefinitionContext columnDefinition = ctx.columnDefinition();
if (null != columnDefinition) {
AddColumnDefinitionSegment addColumnDefinition = new AddColumnDefinitionSegment(
ctx.columnDefinition().getStart().getStartIndex(), columnDefinition.getStop().getStopIndex(), Collections.singleton((ColumnDefinitionSegment) visit(columnDefinition)));
result.getValue().add(addColumnDefinition);
}
return result;
}
@Override
public ASTNode visitColumnDefinition(final ColumnDefinitionContext ctx) {
ColumnSegment column = (ColumnSegment) visit(ctx.columnName());
DataTypeSegment dataType = (DataTypeSegment) visit(ctx.dataType());
boolean isPrimaryKey = ctx.columnConstraint().stream().anyMatch(each -&gt; null != each.columnConstraintOption() &amp;&amp; null != each.columnConstraintOption().primaryKey());
// TODO parse not null
ColumnDefinitionSegment result = new ColumnDefinitionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), column, dataType, isPrimaryKey, false);
for (ColumnConstraintContext each : ctx.columnConstraint()) {
if (null != each.columnConstraintOption().tableName()) {
result.getReferencedTables().add((SimpleTableSegment) visit(each.columnConstraintOption().tableName()));
}
}
return result;
}
@Override
public ASTNode visitTableConstraintUsingIndex(final TableConstraintUsingIndexContext ctx) {
ConstraintDefinitionSegment result = new ConstraintDefinitionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex());
if (null != ctx.constraintName()) {
result.setConstraintName((ConstraintSegment) visit(ctx.constraintName()));
}
if (null != ctx.indexName()) {
result.setIndexName((IndexSegment) visit(ctx.indexName()));
}
return result;
}
@SuppressWarnings(&quot;unchecked&quot;)
@Override
public ASTNode visitTableConstraint(final TableConstraintContext ctx) {
ConstraintDefinitionSegment result = new ConstraintDefinitionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex());
if (null != ctx.constraintClause()) {
result.setConstraintName((ConstraintSegment) visit(ctx.constraintClause().constraintName()));
}
if (null != ctx.tableConstraintOption().primaryKey()) {
result.getPrimaryKeyColumns().addAll(((CollectionValue&lt;ColumnSegment&gt;) visit(ctx.tableConstraintOption().columnNames(0))).getValue());
}
if (null != ctx.tableConstraintOption().FOREIGN()) {
result.setReferencedTable((SimpleTableSegment) visit(ctx.tableConstraintOption().tableName()));
}
return result;
}
@Override
public ASTNode visitModifyColumnSpecification(final ModifyColumnSpecificationContext ctx) {
// TODO visit pk and table ref
ColumnSegment column = (ColumnSegment) visit(ctx.modifyColumn().columnName());
DataTypeSegment dataType = null == ctx.dataType() ? null : (DataTypeSegment) visit(ctx.dataType());
ColumnDefinitionSegment columnDefinition = new ColumnDefinitionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), column, dataType, false, false);
return new ModifyColumnDefinitionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), columnDefinition);
}
@Override
public ASTNode visitDropColumnSpecification(final DropColumnSpecificationContext ctx) {
return new DropColumnDefinitionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), Collections.singleton((ColumnSegment) visit(ctx.columnName())));
}
@Override
public ASTNode visitRenameColumnSpecification(final RenameColumnSpecificationContext ctx) {
return new RenameColumnSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), (ColumnSegment) visit(ctx.columnName(0)), (ColumnSegment) visit(ctx.columnName(1)));
}
@SuppressWarnings(&quot;unchecked&quot;)
@Override
public ASTNode visitDropTable(final DropTableContext ctx) {
boolean containsCascade = null != ctx.dropTableOpt() &amp;&amp; null != ctx.dropTableOpt().CASCADE();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L1063">1063</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L1259">1259</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
@Override
public ASTNode visitNext(final NextContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.NEXT);
return result;
}
@Override
public ASTNode visitPrior(final PriorContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.PRIOR);
return result;
}
@Override
public ASTNode visitFirst(final FirstContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.FIRST);
return result;
}
@Override
public ASTNode visitLast(final LastContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.LAST);
return result;
}
@Override
public ASTNode visitAbsoluteCount(final AbsoluteCountContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.ABSOLUTE_COUNT);
result.setCount(((NumberLiteralValue) visit(ctx.signedIconst())).getValue().longValue());
return result;
}
@Override
public ASTNode visitRelativeCount(final RelativeCountContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.RELATIVE_COUNT);
result.setCount(((NumberLiteralValue) visit(ctx.signedIconst())).getValue().longValue());
return result;
}
@Override
public ASTNode visitCount(final CountContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.COUNT);
result.setCount(((NumberLiteralValue) visit(ctx.signedIconst())).getValue().longValue());
return result;
}
@Override
public ASTNode visitAll(final AllContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.ALL);
return result;
}
@Override
public ASTNode visitForward(final ForwardContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.FORWARD);
return result;
}
@Override
public ASTNode visitForwardCount(final ForwardCountContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.FORWARD_COUNT);
result.setCount(((NumberLiteralValue) visit(ctx.signedIconst())).getValue().longValue());
return result;
}
@Override
public ASTNode visitForwardAll(final ForwardAllContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.FORWARD_ALL);
return result;
}
@Override
public ASTNode visitBackward(final BackwardContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.BACKWARD);
return result;
}
@Override
public ASTNode visitBackwardCount(final BackwardCountContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.BACKWARD_COUNT);
result.setCount(((NumberLiteralValue) visit(ctx.signedIconst())).getValue().longValue());
return result;
}
@Override
public ASTNode visitBackwardAll(final BackwardAllContext ctx) {
DirectionSegment result = new DirectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
result.setDirectionType(DirectionType.BACKWARD_ALL);
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java</td>
<td>shardingsphere-jdbc</td>
<td><a href="./xref/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.html#L31">31</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedOperationResultSet.java</td>
<td>shardingsphere-sql-federation-core</td>
<td><a href="./xref/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedOperationResultSet.html#L31">31</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public abstract class AbstractUnsupportedOperationResultSet extends AbstractUnsupportedUpdateOperationResultSet {
@Override
public boolean previous() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;previous&quot;);
}
@Override
public boolean isBeforeFirst() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;isBeforeFirst&quot;);
}
@Override
public boolean isAfterLast() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;isAfterLast&quot;);
}
@Override
public boolean isFirst() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;isFirst&quot;);
}
@Override
public boolean isLast() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;isLast&quot;);
}
@Override
public void beforeFirst() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;beforeFirst&quot;);
}
@Override
public void afterLast() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;afterLast&quot;);
}
@Override
public boolean first() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;first&quot;);
}
@Override
public boolean last() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;last&quot;);
}
@Override
public boolean absolute(final int row) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;absolute&quot;);
}
@Override
public boolean relative(final int rows) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;relative&quot;);
}
@Override
public int getRow() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getRow&quot;);
}
@Override
public final void insertRow() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;insertRow&quot;);
}
@Override
public final void updateRow() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;updateRow&quot;);
}
@Override
public final void deleteRow() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;deleteRow&quot;);
}
@Override
public final void refreshRow() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;refreshRow&quot;);
}
@Override
public final void cancelRowUpdates() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;cancelRowUpdates&quot;);
}
@Override
public final void moveToInsertRow() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;moveToInsertRow&quot;);
}
@Override
public final void moveToCurrentRow() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;moveToCurrentRow&quot;);
}
@Override
public final boolean rowInserted() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;rowInserted&quot;);
}
@Override
public final boolean rowUpdated() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;rowUpdated&quot;);
}
@Override
public final boolean rowDeleted() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;rowDeleted&quot;);
}
@Override
public final String getCursorName() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getCursorName&quot;);
}
@Override
public final int getHoldability() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getHoldability&quot;);
}
@Override
public final NClob getNClob(final int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getNClob&quot;);
}
@Override
public final NClob getNClob(final String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getNClob&quot;);
}
@Override
public final Reader getNCharacterStream(final int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getNCharacterStream&quot;);
}
@Override
public final Reader getNCharacterStream(final String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getNCharacterStream&quot;);
}
@Override
public final Ref getRef(final int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getRef&quot;);
}
@Override
public final Ref getRef(final String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getRef&quot;);
}
@Override
public final RowId getRowId(final int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getRowId&quot;);
}
@Override
public final RowId getRowId(final String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getRowId&quot;);
}
@Override
public &lt;T&gt; T getObject(final int columnIndex, final Class&lt;T&gt; type) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getObject with type&quot;);
}
@Override
public &lt;T&gt; T getObject(final String columnLabel, final Class&lt;T&gt; type) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getObject with type&quot;);
}
@Override
public final Object getObject(final String columnLabel, final Map&lt;String, Class&lt;?&gt;&gt; map) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getObject with map&quot;);
}
@Override
public final Object getObject(final int columnIndex, final Map&lt;String, Class&lt;?&gt;&gt; map) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getObject with map&quot;);
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L801">801</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L778">778</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>@Override
public ASTNode visitInsertColumnList(final InsertColumnListContext ctx) {
CollectionValue&lt;ColumnSegment&gt; result = new CollectionValue&lt;&gt;();
if (null != ctx.insertColumnList()) {
result.getValue().addAll(((CollectionValue&lt;ColumnSegment&gt;) visit(ctx.insertColumnList())).getValue());
}
result.getValue().add((ColumnSegment) visit(ctx.insertColumnItem()));
return result;
}
@Override
public ASTNode visitInsertColumnItem(final InsertColumnItemContext ctx) {
if (null == ctx.optIndirection().indirectionEl()) {
return new ColumnSegment(ctx.colId().start.getStartIndex(), ctx.colId().stop.getStopIndex(), new IdentifierValue(ctx.colId().getText()));
}
ColumnSegment result = new ColumnSegment(
ctx.colId().start.getStartIndex(), ctx.optIndirection().stop.getStopIndex(), new IdentifierValue(ctx.optIndirection().indirectionEl().attrName().getText()));
result.setOwner(new OwnerSegment(ctx.colId().start.getStartIndex(), ctx.colId().stop.getStopIndex(), new IdentifierValue(ctx.colId().getText())));
return result;
}
private Collection&lt;InsertValuesSegment&gt; createInsertValuesSegments(final ValuesClauseContext ctx) {
Collection&lt;InsertValuesSegment&gt; result = new LinkedList&lt;&gt;();
if (null != ctx.valuesClause()) {
Collection&lt;InsertValuesSegment&gt; expressions = createInsertValuesSegments(ctx.valuesClause());
result.addAll(expressions);
}
Collection&lt;ExpressionSegment&gt; expressions = createInsertValuesSegments(ctx.exprList());
InsertValuesSegment insertValuesSegment = new InsertValuesSegment(ctx.LP_().getSymbol().getStartIndex(), ctx.RP_().getSymbol().getStopIndex(), (List&lt;ExpressionSegment&gt;) expressions);
result.add(insertValuesSegment);
return result;
}
private Collection&lt;ExpressionSegment&gt; createInsertValuesSegments(final ExprListContext ctx) {
Collection&lt;ExpressionSegment&gt; result = new LinkedList&lt;&gt;();
if (null != ctx.exprList()) {
Collection&lt;ExpressionSegment&gt; tmpResult = createInsertValuesSegments(ctx.exprList());
result.addAll(tmpResult);
}
ExpressionSegment expr = (ExpressionSegment) visit(ctx.aExpr());
result.add(expr);
return result;
}
private Collection&lt;ColumnAssignmentSegment&gt; generateAssignmentSegments(final SetClauseListContext ctx) {
Collection&lt;ColumnAssignmentSegment&gt; result = new LinkedList&lt;&gt;();
if (null != ctx.setClauseList()) {
Collection&lt;ColumnAssignmentSegment&gt; tmpResult = generateAssignmentSegments(ctx.setClauseList());
result.addAll(tmpResult);
}
ColumnAssignmentSegment assignmentSegment = (ColumnAssignmentSegment) visit(ctx.setClause());
result.add(assignmentSegment);
return result;
}
@Override
public ASTNode visitSetClause(final SetClauseContext ctx) {
ColumnSegment columnSegment = (ColumnSegment) visit(ctx.setTarget());
List&lt;ColumnSegment&gt; columnSegments = new LinkedList&lt;&gt;();
columnSegments.add(columnSegment);
ExpressionSegment expressionSegment = (ExpressionSegment) visit(ctx.aExpr());
return new ColumnAssignmentSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), columnSegments, expressionSegment);
}
@Override
public ASTNode visitSetTarget(final SetTargetContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L462">462</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L243">243</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L442">442</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>return new DatetimeExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, text);
}
private ASTNode createBinaryOperationExpression(final ExprContext ctx, final String operator) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.expr(0));
ExpressionSegment right = (ExpressionSegment) visit(ctx.expr(1));
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
@Override
public final ASTNode visitBooleanPrimary(final BooleanPrimaryContext ctx) {
if (null != ctx.IS()) {
String rightText = &quot;&quot;;
if (null != ctx.NOT()) {
rightText = rightText.concat(ctx.start.getInputStream().getText(new Interval(ctx.NOT().getSymbol().getStartIndex(), ctx.NOT().getSymbol().getStopIndex()))).concat(&quot; &quot;);
}
Token operatorToken = null;
if (null != ctx.NULL()) {
operatorToken = ctx.NULL().getSymbol();
}
if (null != ctx.TRUE()) {
operatorToken = ctx.TRUE().getSymbol();
}
if (null != ctx.FALSE()) {
operatorToken = ctx.FALSE().getSymbol();
}
int startIndex = null == operatorToken ? ctx.IS().getSymbol().getStopIndex() + 2 : operatorToken.getStartIndex();
rightText = rightText.concat(ctx.start.getInputStream().getText(new Interval(startIndex, ctx.stop.getStopIndex())));
ExpressionSegment right = new LiteralExpressionSegment(ctx.IS().getSymbol().getStopIndex() + 2, ctx.stop.getStopIndex(), rightText);
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
ExpressionSegment left = (ExpressionSegment) visit(ctx.booleanPrimary());
String operator = &quot;IS&quot;;
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
if (null != ctx.comparisonOperator() || null != ctx.SAFE_EQ_()) {
return createCompareSegment(ctx);
}
return visit(ctx.predicate());
}
private ASTNode createCompareSegment(final BooleanPrimaryContext ctx) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.booleanPrimary());
ExpressionSegment right;
if (null != ctx.predicate()) {
right = (ExpressionSegment) visit(ctx.predicate());
} else {
right = new SubqueryExpressionSegment(</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L335">335</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L534">534</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
boolean not = null != ctx.NOT();
return new InExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, not);
}
private BetweenExpression createBetweenSegment(final PredicateContext ctx) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.bitExpr(0));
ExpressionSegment between = (ExpressionSegment) visit(ctx.bitExpr(1));
ExpressionSegment and = (ExpressionSegment) visit(ctx.predicate());
boolean not = null != ctx.NOT();
return new BetweenExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, between, and, not);
}
@Override
public final ASTNode visitBitExpr(final BitExprContext ctx) {
if (null != ctx.simpleExpr()) {
return createExpressionSegment(visit(ctx.simpleExpr()), ctx);
}
ExpressionSegment left = (ExpressionSegment) visit(ctx.getChild(0));
ExpressionSegment right = (ExpressionSegment) visit(ctx.getChild(2));
String operator = ctx.getChild(1).getText();
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
private ASTNode createExpressionSegment(final ASTNode astNode, final ParserRuleContext context) {
if (astNode instanceof StringLiteralValue) {
return new LiteralExpressionSegment(context.start.getStartIndex(), context.stop.getStopIndex(), ((StringLiteralValue) astNode).getValue());
}
if (astNode instanceof NumberLiteralValue) {
return new LiteralExpressionSegment(context.start.getStartIndex(), context.stop.getStopIndex(), ((NumberLiteralValue) astNode).getValue());
}
if (astNode instanceof BooleanLiteralValue) {
return new LiteralExpressionSegment(context.start.getStartIndex(), context.stop.getStopIndex(), ((BooleanLiteralValue) astNode).getValue());
}
if (astNode instanceof ParameterMarkerValue) {
ParameterMarkerValue parameterMarker = (ParameterMarkerValue) astNode;
ParameterMarkerExpressionSegment segment = new ParameterMarkerExpressionSegment(context.start.getStartIndex(), context.stop.getStopIndex(),
parameterMarker.getValue(), parameterMarker.getType());
parameterMarkerSegments.add(segment);
return segment;
}
if (astNode instanceof SubquerySegment) {
return new SubqueryExpressionSegment((SubquerySegment) astNode);
}
if (astNode instanceof OtherLiteralValue) {
return new CommonExpressionSegment(context.getStart().getStartIndex(), context.getStop().getStopIndex(), ((OtherLiteralValue) astNode).getValue());</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/infra/database/opengauss/metadata/data/loader/OpenGaussMetaDataLoader.java</td>
<td>shardingsphere-infra-database-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/infra/database/opengauss/metadata/data/loader/OpenGaussMetaDataLoader.html#L79">79</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/infra/database/postgresql/metadata/data/loader/PostgreSQLMetaDataLoader.java</td>
<td>shardingsphere-infra-database-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/infra/database/postgresql/metadata/data/loader/PostgreSQLMetaDataLoader.html#L91">91</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>result.add(new SchemaMetaData(each, createTableMetaDataList(tableIndexMetaDataMap, tableColumnMetaDataMap)));
}
return result;
}
}
private Map&lt;String, Multimap&lt;String, IndexMetaData&gt;&gt; loadIndexMetaDataMap(final Connection connection, final Collection&lt;String&gt; schemaNames) throws SQLException {
Map&lt;String, Multimap&lt;String, IndexMetaData&gt;&gt; result = new LinkedHashMap&lt;&gt;();
try (PreparedStatement preparedStatement = connection.prepareStatement(getIndexMetaDataSQL(schemaNames)); ResultSet resultSet = preparedStatement.executeQuery()) {
while (resultSet.next()) {
String schemaName = resultSet.getString(&quot;schemaname&quot;);
String tableName = resultSet.getString(&quot;tablename&quot;);
String indexName = resultSet.getString(&quot;indexname&quot;);
Multimap&lt;String, IndexMetaData&gt; indexMetaDataMap = result.computeIfAbsent(schemaName, key -&gt; LinkedHashMultimap.create());
indexMetaDataMap.put(tableName, new IndexMetaData(indexName));
}
}
try (PreparedStatement preparedStatement = connection.prepareStatement(getAdvanceIndexMetaDataSQL(schemaNames)); ResultSet resultSet = preparedStatement.executeQuery()) {
while (resultSet.next()) {
String schemaName = resultSet.getString(&quot;index_schema&quot;);
String tableName = resultSet.getString(&quot;table_name&quot;);
String columnName = resultSet.getString(&quot;column_name&quot;);
String indexName = resultSet.getString(&quot;index_name&quot;);
boolean isUnique = resultSet.getBoolean(&quot;is_unique&quot;);
Collection&lt;IndexMetaData&gt; indexMetaDatas = result.getOrDefault(schemaName, LinkedHashMultimap.create()).get(tableName);
if (indexMetaDatas.isEmpty()) {
continue;
}
Optional&lt;IndexMetaData&gt; indexMetaData = indexMetaDatas.stream().filter(each -&gt; each.getName().equals(indexName)).findFirst();
if (indexMetaData.isPresent()) {
indexMetaData.get().setUnique(isUnique);
indexMetaData.get().getColumns().add(columnName);
}
}
}
return result;
}
private String getIndexMetaDataSQL(final Collection&lt;String&gt; schemaNames) {
return String.format(BASIC_INDEX_META_DATA_SQL, schemaNames.stream().map(each -&gt; String.format(&quot;'%s'&quot;, each)).collect(Collectors.joining(&quot;,&quot;)));
}
private String getAdvanceIndexMetaDataSQL(final Collection&lt;String&gt; schemaNames) {
return String.format(ADVANCE_INDEX_META_DATA_SQL, schemaNames.stream().map(each -&gt; String.format(&quot;'%s'&quot;, each)).collect(Collectors.joining(&quot;,&quot;)));
}
private Map&lt;String, Multimap&lt;String, ColumnMetaData&gt;&gt; loadColumnMetaDataMap(final Connection connection, final Collection&lt;String&gt; tables,
final Collection&lt;String&gt; schemaNames) throws SQLException {
Map&lt;String, Multimap&lt;String, ColumnMetaData&gt;&gt; result = new LinkedHashMap&lt;&gt;();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/proxy/frontend/opengauss/command/query/simple/OpenGaussComQueryExecutor.java</td>
<td>shardingsphere-proxy-frontend-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/proxy/frontend/opengauss/command/query/simple/OpenGaussComQueryExecutor.html#L70">70</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/proxy/frontend/postgresql/command/query/simple/PostgreSQLComQueryExecutor.java</td>
<td>shardingsphere-proxy-frontend-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/simple/PostgreSQLComQueryExecutor.html#L70">70</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public OpenGaussComQueryExecutor(final PortalContext portalContext, final PostgreSQLComQueryPacket packet, final ConnectionSession connectionSession) throws SQLException {
this.portalContext = portalContext;
DatabaseType databaseType = TypedSPILoader.getService(DatabaseType.class, &quot;openGauss&quot;);
SQLStatement sqlStatement = ProxySQLComQueryParser.parse(packet.getSQL(), databaseType, connectionSession);
proxyBackendHandler = ProxyBackendHandlerFactory.newInstance(databaseType, packet.getSQL(), sqlStatement, connectionSession, packet.getHintValueContext());
}
@Override
public Collection&lt;DatabasePacket&gt; execute() throws SQLException {
ResponseHeader responseHeader = proxyBackendHandler.execute();
if (responseHeader instanceof QueryResponseHeader) {
return Collections.singleton(createRowDescriptionPacket((QueryResponseHeader) responseHeader));
}
responseType = ResponseType.UPDATE;
return createUpdatePacket((UpdateResponseHeader) responseHeader);
}
private PostgreSQLRowDescriptionPacket createRowDescriptionPacket(final QueryResponseHeader queryResponseHeader) {
responseType = ResponseType.QUERY;
return new PostgreSQLRowDescriptionPacket(createColumnDescriptions(queryResponseHeader));
}
private Collection&lt;PostgreSQLColumnDescription&gt; createColumnDescriptions(final QueryResponseHeader queryResponseHeader) {
Collection&lt;PostgreSQLColumnDescription&gt; result = new LinkedList&lt;&gt;();
int columnIndex = 0;
for (QueryHeader each : queryResponseHeader.getQueryHeaders()) {
result.add(new PostgreSQLColumnDescription(each.getColumnLabel(), ++columnIndex, each.getColumnType(), each.getColumnLength(), each.getColumnTypeName()));
}
return result;
}
private Collection&lt;DatabasePacket&gt; createUpdatePacket(final UpdateResponseHeader updateResponseHeader) throws SQLException {
SQLStatement sqlStatement = updateResponseHeader.getSqlStatement();
if (sqlStatement instanceof CommitStatement || sqlStatement instanceof RollbackStatement) {
portalContext.closeAll();
}
if (sqlStatement instanceof SetStatement) {
return createParameterStatusResponse((SetStatement) sqlStatement);
}
return Collections.singletonList(sqlStatement instanceof EmptyStatement ? new PostgreSQLEmptyQueryResponsePacket()
: new PostgreSQLCommandCompletePacket(PostgreSQLCommand.valueOf(sqlStatement.getClass()).map(PostgreSQLCommand::getTag).orElse(&quot;&quot;), updateResponseHeader.getUpdateCount()));
}
private Collection&lt;DatabasePacket&gt; createParameterStatusResponse(final SetStatement sqlStatement) {
Collection&lt;DatabasePacket&gt; result = new ArrayList&lt;&gt;(2);
result.add(new PostgreSQLCommandCompletePacket(&quot;SET&quot;, 0));
for (VariableAssignSegment each : sqlStatement.getVariableAssigns()) {
result.add(new PostgreSQLParameterStatusPacket(each.getVariable().getVariable(), IdentifierValue.getQuotedContent(each.getAssignValue())));
}
return result;
}
@Override
public boolean next() throws SQLException {
return proxyBackendHandler.next();
}
@Override
public PostgreSQLPacket getQueryRowPacket() throws SQLException {
return new PostgreSQLDataRowPacket(proxyBackendHandler.getRowData().getData());
}
@Override
public void close() throws SQLException {
proxyBackendHandler.close();
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L430">430</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L465">465</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L246">246</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L445">445</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private BinaryOperationExpression createBinaryOperationExpression(final ExprContext ctx, final String operator) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.expr(0));
ExpressionSegment right = (ExpressionSegment) visit(ctx.expr(1));
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
@Override
public final ASTNode visitBooleanPrimary(final BooleanPrimaryContext ctx) {
if (null != ctx.IS()) {
// TODO optimize operatorToken
String rightText = &quot;&quot;;
if (null != ctx.NOT()) {
rightText = rightText.concat(ctx.start.getInputStream().getText(new Interval(ctx.NOT().getSymbol().getStartIndex(),
ctx.NOT().getSymbol().getStopIndex()))).concat(&quot; &quot;);
}
Token operatorToken = null;
if (null != ctx.NULL()) {
operatorToken = ctx.NULL().getSymbol();
}
if (null != ctx.TRUE()) {
operatorToken = ctx.TRUE().getSymbol();
}
if (null != ctx.FALSE()) {
operatorToken = ctx.FALSE().getSymbol();
}
int startIndex = null == operatorToken ? ctx.IS().getSymbol().getStopIndex() + 2 : operatorToken.getStartIndex();
rightText = rightText.concat(ctx.start.getInputStream().getText(new Interval(startIndex, ctx.stop.getStopIndex())));
ExpressionSegment right = new LiteralExpressionSegment(ctx.IS().getSymbol().getStopIndex() + 2, ctx.stop.getStopIndex(), rightText);
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
ExpressionSegment left = (ExpressionSegment) visit(ctx.booleanPrimary());
String operator = &quot;IS&quot;;
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
if (null != ctx.comparisonOperator() || null != ctx.SAFE_EQ_()) {
return createCompareSegment(ctx);
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L414">414</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L626">626</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), getOriginalText(ctx));
}
@Override
public final ASTNode visitFunctionCall(final FunctionCallContext ctx) {
if (null != ctx.aggregationFunction()) {
return visit(ctx.aggregationFunction());
}
if (null != ctx.specialFunction()) {
return visit(ctx.specialFunction());
}
if (null != ctx.regularFunction()) {
return visit(ctx.regularFunction());
}
throw new IllegalStateException(&quot;FunctionCallContext must have aggregationFunction, regularFunction or specialFunction.&quot;);
}
@Override
public final ASTNode visitAggregationFunction(final AggregationFunctionContext ctx) {
String aggregationType = ctx.aggregationFunctionName().getText();
return AggregationType.isAggregationType(aggregationType)
? createAggregationSegment(ctx, aggregationType)
: new ExpressionProjectionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), getOriginalText(ctx));
}
private ASTNode createAggregationSegment(final AggregationFunctionContext ctx, final String aggregationType) {
AggregationType type = AggregationType.valueOf(aggregationType.toUpperCase());
if (null != ctx.distinct()) {
AggregationDistinctProjectionSegment result =
new AggregationDistinctProjectionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), type, getOriginalText(ctx), getDistinctExpression(ctx));
result.getParameters().addAll(getExpressions(ctx));
return result;
}
AggregationProjectionSegment result = new AggregationProjectionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), type, getOriginalText(ctx));
result.getParameters().addAll(getExpressions(ctx));
return result;
}
private Collection&lt;ExpressionSegment&gt; getExpressions(final AggregationFunctionContext ctx) {
if (null == ctx.expr()) {
return Collections.emptyList();
}
Collection&lt;ExpressionSegment&gt; result = new LinkedList&lt;&gt;();
for (ExprContext each : ctx.expr()) {
result.add((ExpressionSegment) visit(each));
}
return result;
}
private String getDistinctExpression(final AggregationFunctionContext ctx) {
StringBuilder result = new StringBuilder();
for (int i = 3; i &lt; ctx.getChildCount() - 1; i++) {
result.append(ctx.getChild(i).getText());
}
return result.toString();
}
@Override
public final ASTNode visitSpecialFunction(final SpecialFunctionContext ctx) {
if (null != ctx.castFunction()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L556">556</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L337">337</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L536">536</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
private BetweenExpression createBetweenSegment(final PredicateContext ctx) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.bitExpr(0));
ExpressionSegment between = (ExpressionSegment) visit(ctx.bitExpr(1));
ExpressionSegment and = (ExpressionSegment) visit(ctx.predicate());
boolean not = null != ctx.NOT();
return new BetweenExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, between, and, not);
}
@Override
public final ASTNode visitBitExpr(final BitExprContext ctx) {
if (null != ctx.simpleExpr()) {
return createExpressionSegment(visit(ctx.simpleExpr()), ctx);
}
ExpressionSegment left = (ExpressionSegment) visit(ctx.getChild(0));
ExpressionSegment right = (ExpressionSegment) visit(ctx.getChild(2));
String operator = ctx.getChild(1).getText();
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
private ASTNode createExpressionSegment(final ASTNode astNode, final ParserRuleContext context) {
if (astNode instanceof StringLiteralValue) {
return new LiteralExpressionSegment(context.start.getStartIndex(), context.stop.getStopIndex(), ((StringLiteralValue) astNode).getValue());
}
if (astNode instanceof NumberLiteralValue) {
return new LiteralExpressionSegment(context.start.getStartIndex(), context.stop.getStopIndex(), ((NumberLiteralValue) astNode).getValue());
}
if (astNode instanceof BooleanLiteralValue) {
return new LiteralExpressionSegment(context.start.getStartIndex(), context.stop.getStopIndex(), ((BooleanLiteralValue) astNode).getValue());
}
if (astNode instanceof ParameterMarkerValue) {
ParameterMarkerValue parameterMarker = (ParameterMarkerValue) astNode;
ParameterMarkerExpressionSegment segment = new ParameterMarkerExpressionSegment(context.start.getStartIndex(), context.stop.getStopIndex(),
parameterMarker.getValue(), parameterMarker.getType());</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L332">332</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L415">415</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return new OpenGaussAlterDefaultPrivilegesStatement();
}
@Override
public ASTNode visitAlterDefinitionClause(final AlterDefinitionClauseContext ctx) {
CollectionValue&lt;AlterDefinitionSegment&gt; result = new CollectionValue&lt;&gt;();
if (null != ctx.alterTableActions()) {
result.getValue().addAll(ctx.alterTableActions().alterTableAction().stream().flatMap(each -&gt; getAlterDefinitionSegments(each).stream()).collect(Collectors.toList()));
}
if (null != ctx.renameColumnSpecification()) {
result.getValue().add((RenameColumnSegment) visit(ctx.renameColumnSpecification()));
}
if (null != ctx.renameTableSpecification()) {
result.getValue().add((RenameTableDefinitionSegment) visit(ctx.renameTableSpecification()));
}
return result;
}
@SuppressWarnings(&quot;unchecked&quot;)
private Collection&lt;AlterDefinitionSegment&gt; getAlterDefinitionSegments(final AlterTableActionContext ctx) {
Collection&lt;AlterDefinitionSegment&gt; result = new LinkedList&lt;&gt;();
if (null != ctx.addColumnSpecification()) {
result.addAll(((CollectionValue&lt;AddColumnDefinitionSegment&gt;) visit(ctx.addColumnSpecification())).getValue());
}
if (null != ctx.addConstraintSpecification() &amp;&amp; null != ctx.addConstraintSpecification().tableConstraint()) {
result.add((AddConstraintDefinitionSegment) visit(ctx.addConstraintSpecification()));
}
if (null != ctx.validateConstraintSpecification()) {
result.add((ValidateConstraintDefinitionSegment) visit(ctx.validateConstraintSpecification()));
}
if (null != ctx.modifyColumnSpecification()) {
result.add((ModifyColumnDefinitionSegment) visit(ctx.modifyColumnSpecification()));
}
if (null != ctx.modifyConstraintSpecification()) {
result.add((ModifyConstraintDefinitionSegment) visit(ctx.modifyConstraintSpecification()));
}
if (null != ctx.dropColumnSpecification()) {
result.add((DropColumnDefinitionSegment) visit(ctx.dropColumnSpecification()));
}
if (null != ctx.dropConstraintSpecification()) {
result.add((DropConstraintDefinitionSegment) visit(ctx.dropConstraintSpecification()));
}
return result;
}
@Override
public ASTNode visitAlterForeignTable(final AlterForeignTableContext ctx) {
return new OpenGaussAlterForeignTableStatement();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L1218">1218</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L1173">1173</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>JoinTableSegment result = new JoinTableSegment();
result.setLeft((TableSegment) visit(ctx.tableReference()));
int startIndex = null == ctx.LP_() ? ctx.tableReference().start.getStartIndex() : ctx.LP_().getSymbol().getStartIndex();
int stopIndex = 0;
AliasSegment alias = null;
if (null == ctx.aliasClause()) {
stopIndex = null == ctx.RP_() ? ctx.tableReference().start.getStopIndex() : ctx.RP_().getSymbol().getStopIndex();
} else {
alias = (AliasSegment) visit(ctx.aliasClause());
startIndex = null == ctx.RP_() ? ctx.joinedTable().stop.getStopIndex() : ctx.RP_().getSymbol().getStopIndex();
}
result.setStartIndex(startIndex);
result.setStopIndex(stopIndex);
visitJoinedTable(ctx.joinedTable(), result);
result.setAlias(alias);
return result;
}
private JoinTableSegment visitJoinedTable(final JoinedTableContext ctx, final JoinTableSegment tableSegment) {
TableSegment right = (TableSegment) visit(ctx.tableReference());
tableSegment.setRight(right);
tableSegment.setJoinType(getJoinType(ctx));
tableSegment.setNatural(null != ctx.naturalJoinType());
return null == ctx.joinQual() ? tableSegment : visitJoinQual(ctx.joinQual(), tableSegment);
}
private String getJoinType(final JoinedTableContext ctx) {
if (null != ctx.crossJoinType()) {
return JoinType.CROSS.name();
}
if (null != ctx.innerJoinType()) {
return JoinType.INNER.name();
}
if (null != ctx.outerJoinType()) {
return getOutJoinType(ctx.outerJoinType());
}
if (null != ctx.naturalJoinType()) {
return getNaturalJoinType(ctx.naturalJoinType());
}
return JoinType.COMMA.name();
}
private String getOutJoinType(final OuterJoinTypeContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowFunctionStatusExecutor.java</td>
<td>shardingsphere-proxy-backend-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowFunctionStatusExecutor.html#L47">47</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcedureStatusExecutor.java</td>
<td>shardingsphere-proxy-backend-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcedureStatusExecutor.html#L47">47</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private QueryResultMetaData queryResultMetaData;
private MergedResult mergedResult;
@Override
public void execute(final ConnectionSession connectionSession) {
queryResultMetaData = createQueryResultMetaData();
mergedResult = new TransparentMergedResult(getQueryResult());
}
private QueryResult getQueryResult() {
return new RawMemoryQueryResult(queryResultMetaData, Collections.emptyList());
}
private QueryResultMetaData createQueryResultMetaData() {
List&lt;RawQueryResultColumnMetaData&gt; columns = new ArrayList&lt;&gt;();
columns.add(new RawQueryResultColumnMetaData(&quot;&quot;, &quot;Db&quot;, &quot;Db&quot;, Types.VARCHAR, &quot;VARCHAR&quot;, 255, 0));
columns.add(new RawQueryResultColumnMetaData(&quot;&quot;, &quot;Name&quot;, &quot;Name&quot;, Types.VARCHAR, &quot;VARCHAR&quot;, 255, 0));
columns.add(new RawQueryResultColumnMetaData(&quot;&quot;, &quot;Type&quot;, &quot;Type&quot;, Types.VARCHAR, &quot;VARCHAR&quot;, 64, 0));
columns.add(new RawQueryResultColumnMetaData(&quot;&quot;, &quot;Definer&quot;, &quot;Definer&quot;, Types.VARCHAR, &quot;VARCHAR&quot;, 64, 0));
columns.add(new RawQueryResultColumnMetaData(&quot;&quot;, &quot;Modified&quot;, &quot;Modified&quot;, Types.VARCHAR, &quot;VARCHAR&quot;, 64, 0));
columns.add(new RawQueryResultColumnMetaData(&quot;&quot;, &quot;Created&quot;, &quot;Created&quot;, Types.VARCHAR, &quot;VARCHAR&quot;, 64, 0));
columns.add(new RawQueryResultColumnMetaData(&quot;&quot;, &quot;Security_type&quot;, &quot;Security_type&quot;, Types.VARCHAR, &quot;VARCHAR&quot;, 64, 0));
columns.add(new RawQueryResultColumnMetaData(&quot;&quot;, &quot;Comment&quot;, &quot;Comment&quot;, Types.VARCHAR, &quot;VARCHAR&quot;, 120, 0));
columns.add(new RawQueryResultColumnMetaData(&quot;&quot;, &quot;character_set_client&quot;, &quot;character_set_client&quot;, Types.VARCHAR, &quot;VARCHAR&quot;, 20, 0));
columns.add(new RawQueryResultColumnMetaData(&quot;&quot;, &quot;collation_connection&quot;, &quot;collation_connection&quot;, Types.VARCHAR, &quot;VARCHAR&quot;, 20, 0));
columns.add(new RawQueryResultColumnMetaData(&quot;&quot;, &quot;Database_Collation&quot;, &quot;Database_Collation&quot;, Types.VARCHAR, &quot;VARCHAR&quot;, 20, 0));
return new RawQueryResultMetaData(columns);
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L530">530</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L668">668</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>result.setIndex((IndexSegment) visit(ctx.indexName()));
}
return result;
}
@Override
public ASTNode visitIndexParams(final IndexParamsContext ctx) {
CollectionValue&lt;ColumnSegment&gt; result = new CollectionValue&lt;&gt;();
for (IndexElemContext each : ctx.indexElem()) {
if (null != each.colId()) {
result.getValue().add(new ColumnSegment(each.colId().start.getStartIndex(), each.colId().stop.getStopIndex(), new IdentifierValue(each.colId().getText())));
}
if (null != each.functionExprWindowless()) {
FunctionSegment functionSegment = (FunctionSegment) visit(each.functionExprWindowless());
functionSegment.getParameters().forEach(param -&gt; {
if (param instanceof ColumnSegment) {
result.getValue().add((ColumnSegment) param);
}
});
}
}
return result;
}
@Override
public ASTNode visitFunctionExprWindowless(final FunctionExprWindowlessContext ctx) {
FunctionSegment result = new FunctionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ctx.funcApplication().funcName().getText(), getOriginalText(ctx));
result.getParameters().addAll(getExpressions(ctx.funcApplication().funcArgList().funcArgExpr()));
return result;
}
private Collection&lt;ExpressionSegment&gt; getExpressions(final Collection&lt;FuncArgExprContext&gt; aExprContexts) {
if (null == aExprContexts) {
return Collections.emptyList();
}
Collection&lt;ExpressionSegment&gt; result = new ArrayList&lt;&gt;(aExprContexts.size());
for (FuncArgExprContext each : aExprContexts) {
result.add((ExpressionSegment) visit(each.aExpr()));
}
return result;
}
@Override
public ASTNode visitAlterIndex(final AlterIndexContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L224">224</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L224">224</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L172">172</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>return new NumberLiteralValue(ctx.NUMBER_().getText());
}
@Override
public final ASTNode visitIdentifier(final IdentifierContext ctx) {
UnreservedWordContext unreservedWord = ctx.unreservedWord();
return null == unreservedWord ? new IdentifierValue(ctx.getText()) : visit(unreservedWord);
}
@Override
public final ASTNode visitUnreservedWord(final UnreservedWordContext ctx) {
return new IdentifierValue(ctx.getText());
}
@Override
public final ASTNode visitSchemaName(final SchemaNameContext ctx) {
return visit(ctx.identifier());
}
@Override
public final ASTNode visitTableName(final TableNameContext ctx) {
SimpleTableSegment result = new SimpleTableSegment(new TableNameSegment(ctx.name().getStart().getStartIndex(), ctx.name().getStop().getStopIndex(), (IdentifierValue) visit(ctx.name())));
OwnerContext owner = ctx.owner();
if (null != owner) {
result.setOwner(new OwnerSegment(owner.getStart().getStartIndex(), owner.getStop().getStopIndex(), (IdentifierValue) visit(owner.identifier())));
}
return result;
}
@Override
public final ASTNode visitColumnName(final ColumnNameContext ctx) {
ColumnSegment result = new ColumnSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), (IdentifierValue) visit(ctx.name()));
OwnerContext owner = ctx.owner();
if (null != owner) {
result.setOwner(new OwnerSegment(owner.getStart().getStartIndex(), owner.getStop().getStopIndex(), (IdentifierValue) visit(owner.identifier())));
}
return result;
}
@Override
public final ASTNode visitIndexName(final IndexNameContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1119">1119</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L726">726</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final ASTNode visitTrimFunction(final TrimFunctionContext ctx) {
FunctionSegment result = new FunctionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ctx.TRIM().getText(), getOriginalText(ctx));
if (null != ctx.BOTH()) {
result.getParameters().add(new LiteralExpressionSegment(ctx.BOTH().getSymbol().getStartIndex(), ctx.BOTH().getSymbol().getStopIndex(),
new OtherLiteralValue(ctx.BOTH().getSymbol().getText()).getValue()));
}
if (null != ctx.TRAILING()) {
result.getParameters().add(new LiteralExpressionSegment(ctx.TRAILING().getSymbol().getStartIndex(), ctx.TRAILING().getSymbol().getStopIndex(),
new OtherLiteralValue(ctx.TRAILING().getSymbol().getText()).getValue()));
}
if (null != ctx.LEADING()) {
result.getParameters().add(new LiteralExpressionSegment(ctx.LEADING().getSymbol().getStartIndex(), ctx.LEADING().getSymbol().getStopIndex(),
new OtherLiteralValue(ctx.LEADING().getSymbol().getText()).getValue()));
}
for (ExprContext each : ctx.expr()) {
result.getParameters().add((ExpressionSegment) visit(each));
}
return result;
}
@Override
public final ASTNode visitWeightStringFunction(final WeightStringFunctionContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngine.java</td>
<td>shardingsphere-proxy-frontend-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/proxy/frontend/opengauss/authentication/OpenGaussAuthenticationEngine.html#L91">91</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngine.java</td>
<td>shardingsphere-proxy-frontend-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngine.html#L79">79</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private byte[] md5Salt;
private AuthenticationResult currentAuthResult;
@Override
public int handshake(final ChannelHandlerContext context) {
return ConnectionIdGenerator.getInstance().nextId();
}
@Override
public AuthenticationResult authenticate(final ChannelHandlerContext context, final PacketPayload payload) {
if (SSL_REQUEST_PAYLOAD_LENGTH == payload.getByteBuf().markReaderIndex().readInt() &amp;&amp; SSL_REQUEST_CODE == payload.getByteBuf().readInt()) {
if (ProxySSLContext.getInstance().isSSLEnabled()) {
SslHandler sslHandler = new SslHandler(ProxySSLContext.getInstance().newSSLEngine(context.alloc()), true);
context.pipeline().addFirst(SslHandler.class.getSimpleName(), sslHandler);
context.writeAndFlush(new PostgreSQLSSLWillingPacket());
} else {
context.writeAndFlush(new PostgreSQLSSLUnwillingPacket());
}
return AuthenticationResultBuilder.continued();
}
payload.getByteBuf().resetReaderIndex();
AuthorityRule rule = ProxyContext.getInstance().getContextManager().getMetaDataContexts().getMetaData().getGlobalRuleMetaData().getSingleRule(AuthorityRule.class);
return startupMessageReceived ? processPasswordMessage(context, (PostgreSQLPacketPayload) payload, rule) : processStartupMessage(context, (PostgreSQLPacketPayload) payload, rule);
}
private AuthenticationResult processPasswordMessage(final ChannelHandlerContext context, final PostgreSQLPacketPayload payload, final AuthorityRule rule) {
char messageType = (char) payload.readInt1();
ShardingSpherePreconditions.checkState(PostgreSQLMessagePacketType.PASSWORD_MESSAGE.getValue() == messageType,
() -&gt; new ProtocolViolationException(&quot;password&quot;, Character.toString(messageType)));
PostgreSQLPasswordMessagePacket passwordMessagePacket = new PostgreSQLPasswordMessagePacket(payload);
login(rule, passwordMessagePacket.getDigest());</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/infra/database/opengauss/metadata/data/loader/OpenGaussMetaDataLoader.java</td>
<td>shardingsphere-infra-database-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/infra/database/opengauss/metadata/data/loader/OpenGaussMetaDataLoader.html#L148">148</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/infra/database/postgresql/metadata/data/loader/PostgreSQLMetaDataLoader.java</td>
<td>shardingsphere-infra-database-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/infra/database/postgresql/metadata/data/loader/PostgreSQLMetaDataLoader.html#L179">179</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>Collection&lt;String&gt; result = new HashSet&lt;&gt;();
try (PreparedStatement preparedStatement = connection.prepareStatement(getPrimaryKeyMetaDataSQL(schemaNames)); ResultSet resultSet = preparedStatement.executeQuery()) {
while (resultSet.next()) {
String schemaName = resultSet.getString(&quot;table_schema&quot;);
String tableName = resultSet.getString(&quot;table_name&quot;);
String columnName = resultSet.getString(&quot;column_name&quot;);
result.add(schemaName + &quot;,&quot; + tableName + &quot;,&quot; + columnName);
}
}
return result;
}
private String getPrimaryKeyMetaDataSQL(final Collection&lt;String&gt; schemaNames) {
return String.format(PRIMARY_KEY_META_DATA_SQL, schemaNames.stream().map(each -&gt; String.format(&quot;'%s'&quot;, each)).collect(Collectors.joining(&quot;,&quot;)));
}
private ColumnMetaData loadColumnMetaData(final Map&lt;String, Integer&gt; dataTypeMap, final Collection&lt;String&gt; primaryKeys, final ResultSet resultSet) throws SQLException {
String schemaName = resultSet.getString(&quot;table_schema&quot;);
String tableName = resultSet.getString(&quot;table_name&quot;);
String columnName = resultSet.getString(&quot;column_name&quot;);
String dataType = resultSet.getString(&quot;udt_name&quot;);
boolean isPrimaryKey = primaryKeys.contains(schemaName + &quot;,&quot; + tableName + &quot;,&quot; + columnName);
String columnDefault = resultSet.getString(&quot;column_default&quot;);
boolean generated = null != columnDefault &amp;&amp; columnDefault.startsWith(&quot;nextval(&quot;);
// TODO user defined collation which deterministic is false
boolean caseSensitive = true;
boolean isNullable = &quot;YES&quot;.equals(resultSet.getString(&quot;is_nullable&quot;));
return new ColumnMetaData(columnName, dataTypeMap.get(dataType), isPrimaryKey, generated, caseSensitive, true, false, isNullable);
}
private Collection&lt;TableMetaData&gt; createTableMetaDataList(final Multimap&lt;String, IndexMetaData&gt; tableIndexMetaDataMap, final Multimap&lt;String, ColumnMetaData&gt; tableColumnMetaDataMap) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L1403">1403</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L1353">1353</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return new OpenGaussExecuteStatement();
}
/**
* Get original text.
*
* @param ctx context
* @return original text
*/
protected String getOriginalText(final ParserRuleContext ctx) {
return ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
}
@Override
@SuppressWarnings(&quot;unchecked&quot;)
public ASTNode visitAnyName(final AnyNameContext ctx) {
CollectionValue&lt;NameSegment&gt; result = new CollectionValue&lt;&gt;();
if (null != ctx.attrs()) {
result.combine((CollectionValue&lt;NameSegment&gt;) visit(ctx.attrs()));
}
result.getValue().add(new NameSegment(ctx.colId().getStart().getStartIndex(), ctx.colId().getStop().getStopIndex(), new IdentifierValue(ctx.colId().getText())));
return result;
}
@Override
@SuppressWarnings(&quot;unchecked&quot;)
public ASTNode visitAttrs(final AttrsContext ctx) {
CollectionValue&lt;NameSegment&gt; result = new CollectionValue&lt;&gt;();
result.getValue().add(new NameSegment(ctx.attrName().getStart().getStartIndex(), ctx.attrName().getStop().getStopIndex(), new IdentifierValue(ctx.attrName().getText())));
if (null != ctx.attrs()) {
result.combine((CollectionValue&lt;NameSegment&gt;) visit(ctx.attrs()));
}
return result;
}
@Override
public ASTNode visitSignedIconst(final SignedIconstContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L297">297</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L370">370</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussAlterTableStatement result = new OpenGaussAlterTableStatement();
result.setTable((SimpleTableSegment) visit(ctx.tableNameClause().tableName()));
if (null != ctx.alterDefinitionClause()) {
for (AlterDefinitionSegment each : ((CollectionValue&lt;AlterDefinitionSegment&gt;) visit(ctx.alterDefinitionClause())).getValue()) {
if (each instanceof AddColumnDefinitionSegment) {
result.getAddColumnDefinitions().add((AddColumnDefinitionSegment) each);
} else if (each instanceof ModifyColumnDefinitionSegment) {
result.getModifyColumnDefinitions().add((ModifyColumnDefinitionSegment) each);
} else if (each instanceof DropColumnDefinitionSegment) {
result.getDropColumnDefinitions().add((DropColumnDefinitionSegment) each);
} else if (each instanceof AddConstraintDefinitionSegment) {
result.getAddConstraintDefinitions().add((AddConstraintDefinitionSegment) each);
} else if (each instanceof ValidateConstraintDefinitionSegment) {
result.getValidateConstraintDefinitions().add((ValidateConstraintDefinitionSegment) each);
} else if (each instanceof ModifyConstraintDefinitionSegment) {
result.getModifyConstraintDefinitions().add((ModifyConstraintDefinitionSegment) each);
} else if (each instanceof DropConstraintDefinitionSegment) {
result.getDropConstraintDefinitions().add((DropConstraintDefinitionSegment) each);
} else if (each instanceof RenameTableDefinitionSegment) {
result.setRenameTable(((RenameTableDefinitionSegment) each).getRenameTable());
} else if (each instanceof RenameColumnSegment) {
result.getRenameColumnDefinitions().add((RenameColumnSegment) each);
}
}
}
return result;
}
@Override
public ASTNode visitAlterAggregate(final AlterAggregateContext ctx) {
return new OpenGaussAlterAggregateStatement();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L592">592</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L730">730</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussDropIndexStatement result = new OpenGaussDropIndexStatement(null != ctx.ifExists());
result.getIndexes().addAll(createIndexSegments(((CollectionValue&lt;SimpleTableSegment&gt;) visit(ctx.qualifiedNameList())).getValue()));
return result;
}
private Collection&lt;IndexSegment&gt; createIndexSegments(final Collection&lt;SimpleTableSegment&gt; tableSegments) {
Collection&lt;IndexSegment&gt; result = new LinkedList&lt;&gt;();
for (SimpleTableSegment each : tableSegments) {
result.add(createIndexSegment(each));
}
return result;
}
@Override
public ASTNode visitIndexNames(final IndexNamesContext ctx) {
CollectionValue&lt;IndexSegment&gt; result = new CollectionValue&lt;&gt;();
for (IndexNameContext each : ctx.indexName()) {
result.getValue().add((IndexSegment) visit(each));
}
return result;
}
@Override
public ASTNode visitTableNameClause(final TableNameClauseContext ctx) {
return visit(ctx.tableName());
}
@Override
public ASTNode visitTableNamesClause(final TableNamesClauseContext ctx) {
Collection&lt;SimpleTableSegment&gt; tableSegments = new LinkedList&lt;&gt;();
for (int i = 0; i &lt; ctx.tableNameClause().size(); i++) {
tableSegments.add((SimpleTableSegment) visit(ctx.tableNameClause(i)));
}
CollectionValue&lt;SimpleTableSegment&gt; result = new CollectionValue&lt;&gt;();
result.getValue().addAll(tableSegments);
return result;
}
@Override
public ASTNode visitAlterFunction(final AlterFunctionContext ctx) {
return new OpenGaussAlterFunctionStatement();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L520">520</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L520">520</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>if (null != ctx.indirection()) {
AttrNameContext attrName = ctx.indirection().indirectionEl().attrName();
ColumnSegment result = new ColumnSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), new IdentifierValue(attrName.getText()));
OwnerSegment owner = new OwnerSegment(ctx.colId().start.getStartIndex(), ctx.colId().stop.getStopIndex(), new IdentifierValue(ctx.colId().getText()));
result.setOwner(owner);
return result;
}
return new ColumnSegment(ctx.colId().start.getStartIndex(), ctx.colId().stop.getStopIndex(), new IdentifierValue(ctx.colId().getText()));
}
private InExpression createInSegment(final AExprContext ctx) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.aExpr(0));
ExpressionSegment right = createInExpressionSegment(ctx.inExpr());
boolean not = null != ctx.NOT();
return new InExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, not);
}
@SuppressWarnings(&quot;unchecked&quot;)
private ExpressionSegment createInExpressionSegment(final InExprContext ctx) {
if (null != ctx.selectWithParens()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L534">534</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L914">914</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>SQLUtils.getExactlyNumber(ctx.numberLiterals().getText(), 10).intValue(), orderDirection, null);
}
@Override
public final ASTNode visitDataType(final DataTypeContext ctx) {
DataTypeSegment result = new DataTypeSegment();
result.setDataTypeName(((KeywordValue) visit(ctx.dataTypeName())).getValue());
result.setStartIndex(ctx.start.getStartIndex());
result.setStopIndex(ctx.stop.getStopIndex());
if (null != ctx.dataTypeLength()) {
DataTypeLengthSegment dataTypeLengthSegment = (DataTypeLengthSegment) visit(ctx.dataTypeLength());
result.setDataLength(dataTypeLengthSegment);
}
return result;
}
@Override
public final ASTNode visitDataTypeLength(final DataTypeLengthContext ctx) {
DataTypeLengthSegment result = new DataTypeLengthSegment();
result.setStartIndex(ctx.start.getStartIndex());
result.setStopIndex(ctx.stop.getStartIndex());
List&lt;TerminalNode&gt; numbers = ctx.NUMBER_();
if (numbers.size() == 1) {
result.setPrecision(Integer.parseInt(numbers.get(0).getText()));
}
if (numbers.size() == 2) {
result.setPrecision(Integer.parseInt(numbers.get(0).getText()));
result.setScale(Integer.parseInt(numbers.get(1).getText()));
}
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L261">261</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L261">261</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L385">385</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>}
@Override
public final ASTNode visitIndexName(final IndexNameContext ctx) {
IndexNameSegment indexName = new IndexNameSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), (IdentifierValue) visit(ctx.identifier()));
return new IndexSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), indexName);
}
@Override
public final ASTNode visitConstraintName(final ConstraintNameContext ctx) {
return new ConstraintSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), (IdentifierValue) visit(ctx.identifier()));
}
@Override
public final ASTNode visitTableNames(final TableNamesContext ctx) {
CollectionValue&lt;SimpleTableSegment&gt; result = new CollectionValue&lt;&gt;();
for (TableNameContext each : ctx.tableName()) {
result.getValue().add((SimpleTableSegment) visit(each));
}
return result;
}
@Override
public final ASTNode visitColumnNames(final ColumnNamesContext ctx) {
CollectionValue&lt;ColumnSegment&gt; result = new CollectionValue&lt;&gt;();
for (ColumnNameContext each : ctx.columnName()) {
result.getValue().add((ColumnSegment) visit(each));
}
return result;
}
@Override
public ASTNode visitAExpr(final AExprContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L933">933</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L903">903</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussSelectStatement result = (OpenGaussSelectStatement) visit(ctx.selectClauseN());
if (null != ctx.sortClause()) {
OrderBySegment orderBySegment = (OrderBySegment) visit(ctx.sortClause());
result.setOrderBy(orderBySegment);
}
if (null != ctx.selectLimit()) {
LimitSegment limitSegment = (LimitSegment) visit(ctx.selectLimit());
result.setLimit(limitSegment);
}
if (null != ctx.forLockingClause()) {
LockSegment lockSegment = (LockSegment) visit(ctx.forLockingClause());
result.setLock(lockSegment);
}
return result;
}
@Override
public ASTNode visitForLockingClause(final ForLockingClauseContext ctx) {
return new LockSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
}
@Override
public ASTNode visitSelectWithParens(final SelectWithParensContext ctx) {
if (null != ctx.selectWithParens()) {
return visit(ctx.selectWithParens());
}
return visit(ctx.selectNoParens());
}
@Override
public ASTNode visitSelectClauseN(final SelectClauseNContext ctx) {
if (null != ctx.simpleSelect()) {
return visit(ctx.simpleSelect());
}
if (null != ctx.selectClauseN() &amp;&amp; !ctx.selectClauseN().isEmpty()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L265">265</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L338">338</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussCreateTableStatement result = new OpenGaussCreateTableStatement(null != ctx.ifNotExists());
result.setTable((SimpleTableSegment) visit(ctx.tableName()));
if (null != ctx.createDefinitionClause()) {
CollectionValue&lt;CreateDefinitionSegment&gt; createDefinitions = (CollectionValue&lt;CreateDefinitionSegment&gt;) visit(ctx.createDefinitionClause());
for (CreateDefinitionSegment each : createDefinitions.getValue()) {
if (each instanceof ColumnDefinitionSegment) {
result.getColumnDefinitions().add((ColumnDefinitionSegment) each);
} else if (each instanceof ConstraintDefinitionSegment) {
result.getConstraintDefinitions().add((ConstraintDefinitionSegment) each);
}
}
}
return result;
}
@Override
public ASTNode visitCreateDefinitionClause(final CreateDefinitionClauseContext ctx) {
CollectionValue&lt;CreateDefinitionSegment&gt; result = new CollectionValue&lt;&gt;();
for (CreateDefinitionContext each : ctx.createDefinition()) {
if (null != each.columnDefinition()) {
result.getValue().add((ColumnDefinitionSegment) visit(each.columnDefinition()));
}
if (null != each.tableConstraint()) {
result.getValue().add((ConstraintDefinitionSegment) visit(each.tableConstraint()));
}
}
return result;
}
@SuppressWarnings(&quot;unchecked&quot;)
@Override
public ASTNode visitAlterTable(final AlterTableContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/impl/AlterShardingTableRuleStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/impl/AlterShardingTableRuleStatementAssert.html#L63">63</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/impl/CreateShardingTableRuleStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/impl/CreateShardingTableRuleStatementAssert.html#L67">67</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>Collection&lt;TableRuleSegment&gt; actualTableRules = actual.getRules().stream().map(TableRuleSegment.class::cast).collect(Collectors.toList());
assertShardingTableRules(assertContext, actualTableRules, tableRuleStatementTestCase.getRules());
}
}
}
private static void assertShardingAutoTableRules(final SQLCaseAssertContext assertContext, final Collection&lt;AutoTableRuleSegment&gt; actual, final List&lt;ExpectedAutoTableRule&gt; expected) {
if (null == expected) {
assertNull(actual, assertContext.getText(&quot;Actual sharding auto table rule should not exist.&quot;));
} else {
assertNotNull(actual, assertContext.getText(&quot;Actual sharding auto table rule should exist.&quot;));
int count = 0;
for (AutoTableRuleSegment each : actual) {
AutoTableRuleAssert.assertIs(assertContext, each, expected.get(count));
count++;
}
}
}
private static void assertShardingTableRules(final SQLCaseAssertContext assertContext, final Collection&lt;TableRuleSegment&gt; actual, final List&lt;ExpectedTableRule&gt; expected) {
if (null == expected) {
assertNull(actual, assertContext.getText(&quot;Actual sharding table rule should not exist.&quot;));
} else {
assertNotNull(actual, assertContext.getText(&quot;Actual sharding table rule should exist.&quot;));
int count = 0;
for (TableRuleSegment each : actual) {
TableRuleAssert.assertIs(assertContext, each, expected.get(count));
count++;
}
}
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/mask/algorithm/cover/KeepFromXToYMaskAlgorithm.java</td>
<td>shardingsphere-mask-core</td>
<td><a href="./xref/org/apache/shardingsphere/mask/algorithm/cover/KeepFromXToYMaskAlgorithm.html#L31">31</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/mask/algorithm/cover/MaskFromXToYMaskAlgorithm.java</td>
<td>shardingsphere-mask-core</td>
<td><a href="./xref/org/apache/shardingsphere/mask/algorithm/cover/MaskFromXToYMaskAlgorithm.html#L31">31</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final class KeepFromXToYMaskAlgorithm implements MaskAlgorithm&lt;Object, String&gt; {
private static final String FROM_X = &quot;from-x&quot;;
private static final String TO_Y = &quot;to-y&quot;;
private static final String REPLACE_CHAR = &quot;replace-char&quot;;
private Integer fromX;
private Integer toY;
private Character replaceChar;
@Override
public void init(final Properties props) {
fromX = createFromX(props);
toY = createToY(props);
replaceChar = createReplaceChar(props);
ShardingSpherePreconditions.checkState(fromX &lt;= toY, () -&gt; new AlgorithmInitializationException(this, &quot;fromX must be less than or equal to toY&quot;));
}
private Integer createFromX(final Properties props) {
MaskAlgorithmPropertiesChecker.checkPositiveInteger(props, FROM_X, this);
return Integer.parseInt(props.getProperty(FROM_X));
}
private Integer createToY(final Properties props) {
MaskAlgorithmPropertiesChecker.checkPositiveInteger(props, TO_Y, this);
return Integer.parseInt(props.getProperty(TO_Y));
}
private Character createReplaceChar(final Properties props) {
MaskAlgorithmPropertiesChecker.checkSingleChar(props, REPLACE_CHAR, this);
return props.getProperty(REPLACE_CHAR).charAt(0);
}
@Override
public String mask(final Object plainValue) {
String result = null == plainValue ? null : String.valueOf(plainValue);
if (Strings.isNullOrEmpty(result)) {
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/traffic/yaml/swapper/YamlTrafficDataNodeRuleConfigurationSwapper.java</td>
<td>shardingsphere-traffic-core</td>
<td><a href="./xref/org/apache/shardingsphere/traffic/yaml/swapper/YamlTrafficDataNodeRuleConfigurationSwapper.html#L77">77</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/traffic/yaml/swapper/YamlTrafficRuleConfigurationSwapper.java</td>
<td>shardingsphere-traffic-core</td>
<td><a href="./xref/org/apache/shardingsphere/traffic/yaml/swapper/YamlTrafficRuleConfigurationSwapper.html#L56">56</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private TrafficRuleConfiguration swapToObject(final YamlTrafficRuleConfiguration yamlConfig) {
TrafficRuleConfiguration result = new TrafficRuleConfiguration();
for (Entry&lt;String, YamlTrafficStrategyConfiguration&gt; entry : yamlConfig.getTrafficStrategies().entrySet()) {
YamlTrafficStrategyConfiguration strategyConfig = entry.getValue();
strategyConfig.setName(entry.getKey());
result.getTrafficStrategies().add(strategySwapper.swapToObject(strategyConfig));
}
setAlgorithms(yamlConfig, result);
return result;
}
private void setAlgorithms(final YamlTrafficRuleConfiguration yamlConfig, final TrafficRuleConfiguration ruleConfig) {
if (null != yamlConfig.getTrafficAlgorithms()) {
yamlConfig.getTrafficAlgorithms().forEach((key, value) -&gt; ruleConfig.getTrafficAlgorithms().put(key, algorithmSwapper.swapToObject(value)));
}
if (null != yamlConfig.getLoadBalancers()) {
yamlConfig.getLoadBalancers().forEach((key, value) -&gt; ruleConfig.getLoadBalancers().put(key, algorithmSwapper.swapToObject(value)));
}
}
@Override
public Class&lt;TrafficRuleConfiguration&gt; getTypeClass() {
return TrafficRuleConfiguration.class;
}
@Override
public String getRuleTagName() {
return &quot;TRAFFIC&quot;;
}
@Override
public int getOrder() {
return TrafficOrder.ORDER;
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L403">403</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L209">209</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
@Override
public final ASTNode visitTableNames(final TableNamesContext ctx) {
CollectionValue&lt;SimpleTableSegment&gt; result = new CollectionValue&lt;&gt;();
for (TableNameContext each : ctx.tableName()) {
result.getValue().add((SimpleTableSegment) visit(each));
}
return result;
}
@Override
public final ASTNode visitColumnNames(final ColumnNamesContext ctx) {
CollectionValue&lt;ColumnSegment&gt; result = new CollectionValue&lt;&gt;();
for (ColumnNameContext each : ctx.columnName()) {
result.getValue().add((ColumnSegment) visit(each));
}
return result;
}
@Override
public final ASTNode visitExpr(final ExprContext ctx) {
if (null != ctx.booleanPrimary()) {
return visit(ctx.booleanPrimary());
}
if (null != ctx.LP_()) {
return visit(ctx.expr(0));
}
if (null != ctx.andOperator()) {
return createBinaryOperationExpression(ctx, ctx.andOperator().getText());
}
if (null != ctx.orOperator()) {
return createBinaryOperationExpression(ctx, ctx.orOperator().getText());
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L1012">1012</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L1160">1160</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private void setTableSegment(final OpenGaussCommentStatement statement, final Iterator&lt;NameSegment&gt; nameSegmentIterator) {
Optional&lt;NameSegment&gt; tableName = nameSegmentIterator.hasNext() ? Optional.of(nameSegmentIterator.next()) : Optional.empty();
tableName.ifPresent(optional -&gt; statement.setTable(new SimpleTableSegment(new TableNameSegment(optional.getStartIndex(), optional.getStopIndex(), optional.getIdentifier()))));
Optional&lt;NameSegment&gt; schemaName = nameSegmentIterator.hasNext() ? Optional.of(nameSegmentIterator.next()) : Optional.empty();
schemaName.ifPresent(optional -&gt; statement.getTable().setOwner(new OwnerSegment(optional.getStartIndex(), optional.getStopIndex(), optional.getIdentifier())));
Optional&lt;NameSegment&gt; databaseName = nameSegmentIterator.hasNext() ? Optional.of(nameSegmentIterator.next()) : Optional.empty();
databaseName.ifPresent(optional -&gt; statement.getTable().getOwner()
.ifPresent(owner -&gt; owner.setOwner(new OwnerSegment(optional.getStartIndex(), optional.getStopIndex(), optional.getIdentifier()))));
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedDatabaseMetaDataResultSet.java</td>
<td>shardingsphere-jdbc</td>
<td><a href="./xref/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedDatabaseMetaDataResultSet.html#L39">39</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedGeneratedKeysResultSet.java</td>
<td>shardingsphere-jdbc</td>
<td><a href="./xref/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedGeneratedKeysResultSet.html#L120">120</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>@Override
public final InputStream getAsciiStream(final int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getAsciiStream&quot;);
}
@Override
public final InputStream getAsciiStream(final String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getAsciiStream&quot;);
}
@Override
public final InputStream getUnicodeStream(final int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getUnicodeStream&quot;);
}
@Override
public final InputStream getUnicodeStream(final String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getUnicodeStream&quot;);
}
@Override
public final InputStream getBinaryStream(final int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getBinaryStream&quot;);
}
@Override
public final InputStream getBinaryStream(final String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getBinaryStream&quot;);
}
@Override
public final SQLWarning getWarnings() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getWarnings&quot;);
}
@Override
public final void clearWarnings() throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;clearWarnings&quot;);
}
@Override
public final Reader getCharacterStream(final int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getCharacterStream&quot;);
}
@Override
public final Reader getCharacterStream(final String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;getCharacterStream&quot;);
}
@Override
public final Array getArray(final int columnIndex) throws SQLException {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L394">394</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L482">482</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return new OpenGaussAlterMaterializedViewStatement();
}
@Override
public ASTNode visitAddConstraintSpecification(final AddConstraintSpecificationContext ctx) {
return new AddConstraintDefinitionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), (ConstraintDefinitionSegment) visit(ctx.tableConstraint()));
}
@Override
public ASTNode visitValidateConstraintSpecification(final ValidateConstraintSpecificationContext ctx) {
return new ValidateConstraintDefinitionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), (ConstraintSegment) visit(ctx.constraintName()));
}
@Override
public ASTNode visitModifyConstraintSpecification(final ModifyConstraintSpecificationContext ctx) {
return new ModifyConstraintDefinitionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), (ConstraintSegment) visit(ctx.constraintName()));
}
@Override
public ASTNode visitDropConstraintSpecification(final DropConstraintSpecificationContext ctx) {
return new DropConstraintDefinitionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), (ConstraintSegment) visit(ctx.constraintName()));
}
@Override
public ASTNode visitAlterDomain(final AlterDomainContext ctx) {
return new OpenGaussAlterDomainStatement();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L1163">1163</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L497">497</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>result.getParameters().addAll(getExpressions(ctx.expr()));
return result;
}
@Override
public final ASTNode visitDataTypeName(final DataTypeNameContext ctx) {
Collection&lt;String&gt; dataTypeNames = new LinkedList&lt;&gt;();
for (int i = 0; i &lt; ctx.getChildCount(); i++) {
dataTypeNames.add(ctx.getChild(i).getText());
}
return new KeywordValue(String.join(&quot; &quot;, dataTypeNames));
}
// TODO :FIXME, sql case id: insert_with_str_to_date
private void calculateParameterCount(final Collection&lt;ExprContext&gt; exprContexts) {
for (ExprContext each : exprContexts) {
visit(each);
}
}
@Override
public final ASTNode visitOrderByClause(final OrderByClauseContext ctx) {
Collection&lt;OrderByItemSegment&gt; items = new LinkedList&lt;&gt;();
for (OrderByItemContext each : ctx.orderByItem()) {
items.add((OrderByItemSegment) visit(each));
}
return new OrderBySegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), items);
}
@Override
public final ASTNode visitOrderByItem(final OrderByItemContext ctx) {
OrderDirection orderDirection = null == ctx.DESC() ? OrderDirection.ASC : OrderDirection.DESC;</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L277">277</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L146">146</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
@Override
public final ASTNode visitNumberLiterals(final NumberLiteralsContext ctx) {
return new NumberLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitHexadecimalLiterals(final HexadecimalLiteralsContext ctx) {
// TODO deal with hexadecimalLiterals
return new OtherLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitBitValueLiterals(final BitValueLiteralsContext ctx) {
// TODO deal with bitValueLiterals
return new OtherLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitBooleanLiterals(final BooleanLiteralsContext ctx) {
return new BooleanLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitNullValueLiterals(final NullValueLiteralsContext ctx) {
return new NullLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitIdentifier(final IdentifierContext ctx) {
UnreservedWordContext unreservedWord = ctx.unreservedWord();
return null == unreservedWord ? new IdentifierValue(ctx.getText()) : visit(unreservedWord);
}
@Override
public final ASTNode visitUnreservedWord(final UnreservedWordContext ctx) {
return new IdentifierValue(ctx.getText());
}
@Override
public final ASTNode visitSchemaName(final SchemaNameContext ctx) {
return visit(ctx.identifier());
}
@Override
public final ASTNode visitSynonymName(final SynonymNameContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/mask/algorithm/cover/KeepFirstNLastMMaskAlgorithm.java</td>
<td>shardingsphere-mask-core</td>
<td><a href="./xref/org/apache/shardingsphere/mask/algorithm/cover/KeepFirstNLastMMaskAlgorithm.html#L29">29</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/mask/algorithm/cover/MaskFirstNLastMMaskAlgorithm.java</td>
<td>shardingsphere-mask-core</td>
<td><a href="./xref/org/apache/shardingsphere/mask/algorithm/cover/MaskFirstNLastMMaskAlgorithm.html#L29">29</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final class KeepFirstNLastMMaskAlgorithm implements MaskAlgorithm&lt;Object, String&gt; {
private static final String FIRST_N = &quot;first-n&quot;;
private static final String LAST_M = &quot;last-m&quot;;
private static final String REPLACE_CHAR = &quot;replace-char&quot;;
private Integer firstN;
private Integer lastM;
private Character replaceChar;
@Override
public void init(final Properties props) {
firstN = createFirstN(props);
lastM = createLastM(props);
replaceChar = createReplaceChar(props);
}
private Integer createFirstN(final Properties props) {
MaskAlgorithmPropertiesChecker.checkPositiveInteger(props, FIRST_N, this);
return Integer.parseInt(props.getProperty(FIRST_N));
}
private Integer createLastM(final Properties props) {
MaskAlgorithmPropertiesChecker.checkPositiveInteger(props, LAST_M, this);
return Integer.parseInt(props.getProperty(LAST_M));
}
private Character createReplaceChar(final Properties props) {
MaskAlgorithmPropertiesChecker.checkSingleChar(props, REPLACE_CHAR, this);
return props.getProperty(REPLACE_CHAR).charAt(0);
}
@Override
public String mask(final Object plainValue) {
String result = null == plainValue ? null : String.valueOf(plainValue);
if (Strings.isNullOrEmpty(result)) {
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDALStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDALStatementVisitor.html#L145">145</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDALStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDALStatementVisitor.html#L152">152</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussExplainStatement result = new OpenGaussExplainStatement();
result.setStatement((SQLStatement) visit(ctx.explainableStmt()));
return result;
}
@Override
public ASTNode visitExplainableStmt(final ExplainableStmtContext ctx) {
if (null != ctx.select()) {
return visit(ctx.select());
}
if (null != ctx.insert()) {
return visit(ctx.insert());
}
if (null != ctx.update()) {
return visit(ctx.update());
}
if (null != ctx.delete()) {
return visit(ctx.delete());
}
if (null != ctx.declare()) {
// TODO visit declare statement
return visit(ctx.declare());
}
if (null != ctx.executeStmt()) {
return visit(ctx.executeStmt());
}
if (null != ctx.createMaterializedView()) {
// TODO visit create materialized view statement
return visit(ctx.createMaterializedView());
}
// TODO visit refresh materialized view statement
return visit(ctx.refreshMatViewStmt());
}
@Override
public ASTNode visitEmptyStatement(final EmptyStatementContext ctx) {
return new OpenGaussEmptyStatement();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L111">111</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L250">250</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public abstract class SQL92StatementVisitor extends SQL92StatementBaseVisitor&lt;ASTNode&gt; {
private final Collection&lt;ParameterMarkerSegment&gt; parameterMarkerSegments = new LinkedList&lt;&gt;();
@Override
public final ASTNode visitParameterMarker(final ParameterMarkerContext ctx) {
return new ParameterMarkerValue(parameterMarkerSegments.size(), ParameterMarkerType.QUESTION);
}
@Override
public final ASTNode visitLiterals(final LiteralsContext ctx) {
if (null != ctx.stringLiterals()) {
return visit(ctx.stringLiterals());
}
if (null != ctx.numberLiterals()) {
return visit(ctx.numberLiterals());
}
if (null != ctx.hexadecimalLiterals()) {
return visit(ctx.hexadecimalLiterals());
}
if (null != ctx.bitValueLiterals()) {
return visit(ctx.bitValueLiterals());
}
if (null != ctx.booleanLiterals()) {
return visit(ctx.booleanLiterals());
}
if (null != ctx.nullValueLiterals()) {
return visit(ctx.nullValueLiterals());
}
throw new IllegalStateException(&quot;Literals must have string, number, dateTime, hex, bit, boolean or null.&quot;);
}
@Override
public final ASTNode visitStringLiterals(final StringLiteralsContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.html#L416">416</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L1613">1613</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>SimpleTableSegment result = (SimpleTableSegment) visit(ctx.tableName());
if (null != ctx.alias()) {
result.setAlias((AliasSegment) visit(ctx.alias()));
}
return result;
}
return visit(ctx.tableReferences());
}
private JoinTableSegment visitJoinedTable(final JoinedTableContext ctx, final TableSegment tableSegment) {
JoinTableSegment result = new JoinTableSegment();
result.setLeft(tableSegment);
result.setStartIndex(tableSegment.getStartIndex());
result.setStopIndex(ctx.stop.getStopIndex());
TableSegment right = (TableSegment) visit(ctx.tableFactor());
result.setRight(right);
result.setJoinType(getJoinType(ctx));
if (null != ctx.joinSpecification()) {
visitJoinSpecification(ctx.joinSpecification(), result);
}
return result;
}
private String getJoinType(final JoinedTableContext ctx) {
if (null != ctx.LEFT()) {
return JoinType.LEFT.name();
} else if (null != ctx.RIGHT()) {
return JoinType.RIGHT.name();
} else if (null != ctx.INNER()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/impl/AlterDefaultShardingStrategyStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/impl/AlterDefaultShardingStrategyStatementAssert.html#L45">45</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/impl/CreateDefaultShardingStrategyStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/impl/CreateDefaultShardingStrategyStatementAssert.html#L46">46</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>assertThat(assertContext.getText(String.format(&quot;`%s`'s default sharding strategy segment assertion error: &quot;, actual.getClass().getSimpleName())),
actual.getDefaultType(), is(expected.getStrategy().getDefaultType()));
assertThat(assertContext.getText(String.format(&quot;`%s`'s default sharding strategy segment assertion error: &quot;, actual.getClass().getSimpleName())),
actual.getShardingColumn(), is(expected.getStrategy().getShardingColumn()));
assertThat(assertContext.getText(String.format(&quot;`%s`'s default sharding strategy segment assertion error: &quot;, actual.getClass().getSimpleName())),
actual.getStrategyType(), is(expected.getStrategy().getStrategyType()));
if (!&quot;none&quot;.equalsIgnoreCase(actual.getStrategyType())) {
assertThat(assertContext.getText(String.format(&quot;`%s`'s default sharding strategy segment assertion error: &quot;, actual.getClass().getSimpleName())),
actual.getAlgorithmSegment().getName(), is(expected.getStrategy().getAlgorithmSegment().getName()));
}
}
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java</td>
<td>shardingsphere-opengauss-protocol</td>
<td><a href="./xref/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.html#L97">97</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java</td>
<td>shardingsphere-postgresql-protocol</td>
<td><a href="./xref/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.html#L95">95</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return OpenGaussCommandPacketType.isExtendedProtocolPacketType(commandPacketType)
&amp;&amp; PostgreSQLCommandPacketType.SYNC_COMMAND != commandPacketType &amp;&amp; PostgreSQLCommandPacketType.FLUSH_COMMAND != commandPacketType;
}
private void handlePendingMessages(final ChannelHandlerContext context, final ByteBuf in, final List&lt;Object&gt; out, final int payloadLength) {
CompositeByteBuf result = context.alloc().compositeBuffer(pendingMessages.size() + 1);
result.addComponents(true, pendingMessages).addComponent(true, in.readRetainedSlice(MESSAGE_TYPE_LENGTH + payloadLength));
out.add(result);
pendingMessages.clear();
}
@Override
public void encode(final ChannelHandlerContext context, final DatabasePacket message, final ByteBuf out) {
boolean isIdentifierPacket = message instanceof PostgreSQLIdentifierPacket;
if (isIdentifierPacket) {
prepareMessageHeader(out, ((PostgreSQLIdentifierPacket) message).getIdentifier().getValue());
}
PostgreSQLPacketPayload payload = new PostgreSQLPacketPayload(out, context.channel().attr(CommonConstants.CHARSET_ATTRIBUTE_KEY).get());
try {
message.write(payload);
// CHECKSTYLE:OFF
} catch (final RuntimeException ex) {
// CHECKSTYLE:ON
payload.getByteBuf().resetWriterIndex();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/merge/MergeStatementConverter.java</td>
<td>shardingsphere-sql-federation-optimizer</td>
<td><a href="./xref/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/merge/MergeStatementConverter.html#L54">54</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/update/UpdateStatementConverter.java</td>
<td>shardingsphere-sql-federation-optimizer</td>
<td><a href="./xref/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/update/UpdateStatementConverter.html#L62">62</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>SqlNode table = TableConverter.convert(updateStatement.getTable()).orElse(SqlNodeList.EMPTY);
SqlNode condition = updateStatement.getWhere().flatMap(WhereConverter::convert).orElse(null);
SqlNodeList columns = new SqlNodeList(SqlParserPos.ZERO);
SqlNodeList expressions = new SqlNodeList(SqlParserPos.ZERO);
for (ColumnAssignmentSegment each : updateStatement.getAssignmentSegment().orElseThrow(IllegalStateException::new).getAssignments()) {
columns.addAll(convertColumn(each.getColumns()));
expressions.add(convertExpression(each.getValue()));
}
return new SqlUpdate(SqlParserPos.ZERO, table, columns, expressions, condition, null, null);
}
private List&lt;SqlNode&gt; convertColumn(final List&lt;ColumnSegment&gt; columnSegments) {
return columnSegments.stream().map(each -&gt; ColumnConverter.convert(each).orElseThrow(IllegalStateException::new)).collect(Collectors.toList());
}
private SqlNode convertExpression(final ExpressionSegment expressionSegment) {
return ExpressionConverter.convert(expressionSegment).orElseThrow(IllegalStateException::new);
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L757">757</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L762">762</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussSelectStatement selectStatement = (OpenGaussSelectStatement) visit(ctx.select());
result.setInsertSelect(new SubquerySegment(ctx.select().start.getStartIndex(), ctx.select().stop.getStopIndex(), selectStatement, getOriginalText(ctx.select())));
} else {
result.getValues().addAll(createInsertValuesSegments(valuesClause));
}
if (null == ctx.insertColumnList()) {
result.setInsertColumns(new InsertColumnsSegment(ctx.start.getStartIndex() - 1, ctx.start.getStartIndex() - 1, Collections.emptyList()));
} else {
InsertColumnListContext insertColumns = ctx.insertColumnList();
CollectionValue&lt;ColumnSegment&gt; columns = (CollectionValue&lt;ColumnSegment&gt;) visit(insertColumns);
InsertColumnsSegment insertColumnsSegment = new InsertColumnsSegment(insertColumns.start.getStartIndex() - 1, insertColumns.stop.getStopIndex() + 1, columns.getValue());
result.setInsertColumns(insertColumnsSegment);
}
return result;
}
@Override
public ASTNode visitOptOnDuplicateKey(final OptOnDuplicateKeyContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1511">1511</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.html#L144">144</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>result.setLimit((LimitSegment) visit(ctx.limitClause()));
}
result.addParameterMarkerSegments(getParameterMarkerSegments());
return result;
}
@Override
public ASTNode visitSetAssignmentsClause(final SetAssignmentsClauseContext ctx) {
Collection&lt;ColumnAssignmentSegment&gt; assignments = new LinkedList&lt;&gt;();
for (AssignmentContext each : ctx.assignment()) {
assignments.add((ColumnAssignmentSegment) visit(each));
}
return new SetAssignmentSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), assignments);
}
@Override
public ASTNode visitAssignmentValues(final AssignmentValuesContext ctx) {
List&lt;ExpressionSegment&gt; segments = new LinkedList&lt;&gt;();
for (AssignmentValueContext each : ctx.assignmentValue()) {
segments.add((ExpressionSegment) visit(each));
}
return new InsertValuesSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), segments);
}
@Override
public ASTNode visitAssignment(final AssignmentContext ctx) {
ColumnSegment column = (ColumnSegment) visit(ctx.columnRef());</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1404">1404</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1475">1475</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public ASTNode visitInsertValuesClause(final InsertValuesClauseContext ctx) {
MySQLInsertStatement result = new MySQLInsertStatement();
if (null != ctx.LP_()) {
if (null != ctx.fields()) {
result.setInsertColumns(new InsertColumnsSegment(ctx.LP_().getSymbol().getStartIndex(), ctx.RP_().getSymbol().getStopIndex(), createInsertColumns(ctx.fields())));
} else {
result.setInsertColumns(new InsertColumnsSegment(ctx.LP_().getSymbol().getStartIndex(), ctx.RP_().getSymbol().getStopIndex(), Collections.emptyList()));
}
} else {
result.setInsertColumns(new InsertColumnsSegment(ctx.start.getStartIndex() - 1, ctx.start.getStartIndex() - 1, Collections.emptyList()));
}
result.getValues().addAll(createInsertValuesSegments(ctx.assignmentValues()));
return result;
}
private Collection&lt;InsertValuesSegment&gt; createInsertValuesSegments(final Collection&lt;AssignmentValuesContext&gt; assignmentValuesContexts) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L267">267</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L279">279</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return new DateTimeLiteralValue(dateTimeType, ((StringLiteralValue) visit(ctx.stringLiterals())).getValue(), false);
}
@Override
public final ASTNode visitStringLiterals(final StringLiteralsContext ctx) {
if (null != ctx.STRING_()) {
return new StringLiteralValue(ctx.getText());
} else {
return new StringLiteralValue(ctx.getText().substring(1));
}
}
@Override
public final ASTNode visitNumberLiterals(final NumberLiteralsContext ctx) {
return new NumberLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitHexadecimalLiterals(final HexadecimalLiteralsContext ctx) {
// TODO deal with hexadecimalLiterals
return new OtherLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitBitValueLiterals(final BitValueLiteralsContext ctx) {
// TODO deal with bitValueLiterals
return new OtherLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitBooleanLiterals(final BooleanLiteralsContext ctx) {
return new BooleanLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitNullValueLiterals(final NullValueLiteralsContext ctx) {
return new NullLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitIdentifier(final IdentifierContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L265">265</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L338">338</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.html#L68">68</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussCreateTableStatement result = new OpenGaussCreateTableStatement(null != ctx.ifNotExists());
result.setTable((SimpleTableSegment) visit(ctx.tableName()));
if (null != ctx.createDefinitionClause()) {
CollectionValue&lt;CreateDefinitionSegment&gt; createDefinitions = (CollectionValue&lt;CreateDefinitionSegment&gt;) visit(ctx.createDefinitionClause());
for (CreateDefinitionSegment each : createDefinitions.getValue()) {
if (each instanceof ColumnDefinitionSegment) {
result.getColumnDefinitions().add((ColumnDefinitionSegment) each);
} else if (each instanceof ConstraintDefinitionSegment) {
result.getConstraintDefinitions().add((ConstraintDefinitionSegment) each);
}
}
}
return result;
}
@Override
public ASTNode visitCreateDefinitionClause(final CreateDefinitionClauseContext ctx) {
CollectionValue&lt;CreateDefinitionSegment&gt; result = new CollectionValue&lt;&gt;();
for (CreateDefinitionContext each : ctx.createDefinition()) {
if (null != each.columnDefinition()) {
result.getValue().add((ColumnDefinitionSegment) visit(each.columnDefinition()));
}
if (null != each.tableConstraint()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/data/pipeline/opengauss/ingest/wal/decode/MppdbDecodingPlugin.java</td>
<td>shardingsphere-data-pipeline-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/data/pipeline/opengauss/ingest/wal/decode/MppdbDecodingPlugin.html#L285">285</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPlugin.java</td>
<td>shardingsphere-data-pipeline-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPlugin.html#L292">292</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
private byte[] decodeHex(final String hexString) {
int dataLength = hexString.length();
Preconditions.checkArgument(0 == (dataLength &amp; 1), &quot;Illegal hex data `%s`&quot;, hexString);
if (0 == dataLength) {
return new byte[0];
}
byte[] result = new byte[dataLength &gt;&gt;&gt; 1];
for (int i = 0; i &lt; dataLength; i += 2) {
result[i &gt;&gt;&gt; 1] = decodeHexByte(hexString, i);
}
return result;
}
private byte decodeHexByte(final String hexString, final int index) {
int firstHexChar = Character.digit(hexString.charAt(index), 16);
int secondHexChar = Character.digit(hexString.charAt(index + 1), 16);
Preconditions.checkArgument(-1 != firstHexChar &amp;&amp; -1 != secondHexChar, &quot;Illegal hex byte `%s` in index `%d`&quot;, hexString, index);
return (byte) ((firstHexChar &lt;&lt; 4) + secondHexChar);
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/authority/yaml/swapper/YamlAuthorityDataNodeRuleConfigurationSwapper.java</td>
<td>shardingsphere-authority-core</td>
<td><a href="./xref/org/apache/shardingsphere/authority/yaml/swapper/YamlAuthorityDataNodeRuleConfigurationSwapper.html#L74">74</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/authority/yaml/swapper/YamlAuthorityRuleConfigurationSwapper.java</td>
<td>shardingsphere-authority-core</td>
<td><a href="./xref/org/apache/shardingsphere/authority/yaml/swapper/YamlAuthorityRuleConfigurationSwapper.html#L54">54</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private AuthorityRuleConfiguration swapToObject(final YamlAuthorityRuleConfiguration yamlConfig) {
Collection&lt;ShardingSphereUser&gt; users = yamlConfig.getUsers().stream().map(userSwapper::swapToObject).collect(Collectors.toList());
AlgorithmConfiguration provider = algorithmSwapper.swapToObject(yamlConfig.getPrivilege());
if (null == provider) {
provider = new DefaultAuthorityRuleConfigurationBuilder().build().getPrivilegeProvider();
}
Map&lt;String, AlgorithmConfiguration&gt; authenticators = yamlConfig.getAuthenticators().entrySet().stream()
.collect(Collectors.toMap(Entry::getKey, entry -&gt; algorithmSwapper.swapToObject(entry.getValue())));
return new AuthorityRuleConfiguration(users, provider, authenticators, yamlConfig.getDefaultAuthenticator());
}
@Override
public Class&lt;AuthorityRuleConfiguration&gt; getTypeClass() {
return AuthorityRuleConfiguration.class;
}
@Override
public String getRuleTagName() {
return &quot;AUTHORITY&quot;;
}
@Override
public int getOrder() {
return AuthorityOrder.ORDER;
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L572">572</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L555">555</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
private BetweenExpression createBetweenSegment(final PredicateContext ctx) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.bitExpr(0));
ExpressionSegment between = (ExpressionSegment) visit(ctx.bitExpr(1));
ExpressionSegment and = (ExpressionSegment) visit(ctx.predicate());
boolean not = null != ctx.NOT();
return new BetweenExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, between, and, not);
}
@Override
public final ASTNode visitBitExpr(final BitExprContext ctx) {
if (null != ctx.simpleExpr()) {
return visit(ctx.simpleExpr());</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L545">545</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L309">309</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L508">508</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>return new InExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, not);
}
private BinaryOperationExpression createBinaryOperationExpressionFromLike(final PredicateContext ctx) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.bitExpr(0));
ListExpression right = new ListExpression(ctx.simpleExpr(0).start.getStartIndex(), ctx.simpleExpr().get(ctx.simpleExpr().size() - 1).stop.getStopIndex());
for (SimpleExprContext each : ctx.simpleExpr()) {
right.getItems().add((ExpressionSegment) visit(each));
}
String operator = null == ctx.NOT() ? &quot;LIKE&quot; : &quot;NOT LIKE&quot;;
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
private BetweenExpression createBetweenSegment(final PredicateContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L498">498</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L510">510</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>new SubquerySegment(ctx.subquery().start.getStartIndex(), ctx.subquery().stop.getStopIndex(), (MySQLSelectStatement) visit(ctx.subquery()), getOriginalText(ctx.subquery())));
}
String operator = null == ctx.SAFE_EQ_() ? ctx.comparisonOperator().getText() : ctx.SAFE_EQ_().getText();
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
@Override
public final ASTNode visitPredicate(final PredicateContext ctx) {
if (null != ctx.IN()) {
return createInSegment(ctx);
}
if (null != ctx.BETWEEN()) {
return createBetweenSegment(ctx);
}
if (null != ctx.LIKE()) {
return createBinaryOperationExpressionFromLike(ctx);
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.html#L301">301</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L1500">1500</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>: new AliasSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), (IdentifierValue) visit(ctx.identifier()));
}
private ASTNode createProjection(final ProjectionContext ctx, final AliasSegment alias) {
ASTNode projection = visit(ctx.expr());
if (projection instanceof AggregationProjectionSegment) {
((AggregationProjectionSegment) projection).setAlias(alias);
return projection;
}
if (projection instanceof ExpressionProjectionSegment) {
((ExpressionProjectionSegment) projection).setAlias(alias);
return projection;
}
if (projection instanceof FunctionSegment) {
FunctionSegment segment = (FunctionSegment) projection;
ExpressionProjectionSegment result = new ExpressionProjectionSegment(segment.getStartIndex(), segment.getStopIndex(), segment.getText(), segment);
result.setAlias(alias);
return result;
}
if (projection instanceof CommonExpressionSegment) {
CommonExpressionSegment segment = (CommonExpressionSegment) projection;
ExpressionProjectionSegment result = new ExpressionProjectionSegment(segment.getStartIndex(), segment.getStopIndex(), segment.getText(), segment);
result.setAlias(alias);
return result;
}
// FIXME :For DISTINCT()
if (projection instanceof ColumnSegment) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java</td>
<td>shardingsphere-opengauss-protocol</td>
<td><a href="./xref/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.html#L73">73</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java</td>
<td>shardingsphere-postgresql-protocol</td>
<td><a href="./xref/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.html#L71">71</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>CommandPacketType commandPacketType = OpenGaussCommandPacketType.valueOf(type);
if (requireAggregation(commandPacketType)) {
pendingMessages.add(in.readRetainedSlice(MESSAGE_TYPE_LENGTH + payloadLength));
} else if (pendingMessages.isEmpty()) {
out.add(in.readRetainedSlice(MESSAGE_TYPE_LENGTH + payloadLength));
} else {
handlePendingMessages(context, in, out, payloadLength);
}
}
}
private void handleStartupPhase(final ByteBuf in, final List&lt;Object&gt; out) {
int readerIndex = in.readerIndex();
if (in.readableBytes() == SSL_REQUEST_PAYLOAD_LENGTH &amp;&amp; SSL_REQUEST_PAYLOAD_LENGTH == in.getInt(readerIndex) &amp;&amp; SSL_REQUEST_CODE == in.getInt(readerIndex + 4)) {
out.add(in.readRetainedSlice(SSL_REQUEST_PAYLOAD_LENGTH));
return;
}
if (in.readableBytes() == in.getInt(readerIndex)) {
out.add(in.readRetainedSlice(in.readableBytes()));
startupPhase = false;
}
}
private boolean requireAggregation(final CommandPacketType commandPacketType) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/data/pipeline/cdc/distsql/parser/core/CDCDistSQLStatementVisitor.java</td>
<td>shardingsphere-data-pipeline-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/data/pipeline/cdc/distsql/parser/core/CDCDistSQLStatementVisitor.html#L83">83</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/data/pipeline/migration/distsql/parser/core/MigrationDistSQLStatementVisitor.java</td>
<td>shardingsphere-data-pipeline-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/data/pipeline/migration/distsql/parser/core/MigrationDistSQLStatementVisitor.html#L106">106</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return new AlterTransmissionRuleStatement(&quot;STREAMING&quot;, (TransmissionRuleSegment) visit(ctx.transmissionRule()));
}
@Override
public ASTNode visitTransmissionRule(final TransmissionRuleContext ctx) {
TransmissionRuleSegment result = new TransmissionRuleSegment();
if (null != ctx.readDefinition()) {
result.setReadSegment((ReadOrWriteSegment) visit(ctx.readDefinition()));
}
if (null != ctx.writeDefinition()) {
result.setWriteSegment((ReadOrWriteSegment) visit(ctx.writeDefinition()));
}
if (null != ctx.streamChannel()) {
result.setStreamChannel((AlgorithmSegment) visit(ctx.streamChannel()));
}
return result;
}
@Override
public ASTNode visitReadDefinition(final ReadDefinitionContext ctx) {
return new ReadOrWriteSegment(getWorkerThread(ctx.workerThread()), getBatchSize(ctx.batchSize()), getShardingSize(ctx.shardingSize()), getAlgorithmSegment(ctx.rateLimiter()));
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java</td>
<td>shardingsphere-opengauss-protocol</td>
<td><a href="./xref/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.html#L42">42</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java</td>
<td>shardingsphere-postgresql-protocol</td>
<td><a href="./xref/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.html#L40">40</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final class OpenGaussPacketCodecEngine implements DatabasePacketCodecEngine {
private static final int SSL_REQUEST_PAYLOAD_LENGTH = 8;
private static final int SSL_REQUEST_CODE = (1234 &lt;&lt; 16) + 5679;
private static final int MESSAGE_TYPE_LENGTH = 1;
private static final int PAYLOAD_LENGTH = 4;
private boolean startupPhase = true;
private final List&lt;ByteBuf&gt; pendingMessages = new LinkedList&lt;&gt;();
@Override
public boolean isValidHeader(final int readableBytes) {
return readableBytes &gt;= (startupPhase ? 0 : MESSAGE_TYPE_LENGTH) + PAYLOAD_LENGTH;
}
@Override
public void decode(final ChannelHandlerContext context, final ByteBuf in, final List&lt;Object&gt; out) {
while (isValidHeader(in.readableBytes())) {
if (startupPhase) {
handleStartupPhase(in, out);
return;
}
int payloadLength = in.getInt(in.readerIndex() + 1);
if (in.readableBytes() &lt; MESSAGE_TYPE_LENGTH + payloadLength) {
return;
}
byte type = in.getByte(in.readerIndex());</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sharding/distsql/handler/update/AlterShardingTableReferenceRuleExecutor.java</td>
<td>shardingsphere-sharding-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/distsql/handler/update/AlterShardingTableReferenceRuleExecutor.html#L89">89</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sharding/distsql/handler/update/CreateShardingTableReferenceRuleExecutor.java</td>
<td>shardingsphere-sharding-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/distsql/handler/update/CreateShardingTableReferenceRuleExecutor.html#L75">75</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private void checkToBeReferencedShardingTablesExisted(final AlterShardingTableReferenceRuleStatement sqlStatement) {
Collection&lt;String&gt; currentShardingTableNames = getCurrentShardingTableNames();
Collection&lt;String&gt; notExistedTableNames = sqlStatement.getTableNames().stream().filter(each -&gt; !currentShardingTableNames.contains(each)).collect(Collectors.toSet());
ShardingSpherePreconditions.checkMustEmpty(notExistedTableNames, () -&gt; new MissingRequiredRuleException(&quot;Sharding&quot;, database.getName(), notExistedTableNames));
}
private Collection&lt;String&gt; getCurrentShardingTableNames() {
Collection&lt;String&gt; result = new CaseInsensitiveSet&lt;&gt;();
result.addAll(rule.getConfiguration().getTables().stream().map(ShardingTableRuleConfiguration::getLogicTable).collect(Collectors.toSet()));
result.addAll(rule.getConfiguration().getAutoTables().stream().map(ShardingAutoTableRuleConfiguration::getLogicTable).collect(Collectors.toSet()));
return result;
}
private void checkShardingTableReferenceRulesValid(final AlterShardingTableReferenceRuleStatement sqlStatement) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/infra/binder/context/statement/ddl/FetchStatementContext.java</td>
<td>shardingsphere-infra-binder</td>
<td><a href="./xref/org/apache/shardingsphere/infra/binder/context/statement/ddl/FetchStatementContext.html#L54">54</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/infra/binder/context/statement/ddl/MoveStatementContext.java</td>
<td>shardingsphere-infra-binder</td>
<td><a href="./xref/org/apache/shardingsphere/infra/binder/context/statement/ddl/MoveStatementContext.html#L54">54</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return (FetchStatement) super.getSqlStatement();
}
@Override
public Optional&lt;CursorNameSegment&gt; getCursorName() {
return Optional.of(getSqlStatement().getCursorName());
}
@Override
public void setUpCursorDefinition(final CursorStatementContext cursorStatementContext) {
this.cursorStatementContext = cursorStatementContext;
TableExtractor tableExtractor = new TableExtractor();
tableExtractor.extractTablesFromSelect(cursorStatementContext.getSqlStatement().getSelect());
tablesContext = new TablesContext(tableExtractor.getRewriteTables(), getDatabaseType());
}
@Override
public Collection&lt;WhereSegment&gt; getWhereSegments() {
return null == cursorStatementContext ? Collections.emptyList() : cursorStatementContext.getWhereSegments();
}
@Override
public Collection&lt;ColumnSegment&gt; getColumnSegments() {
return null == cursorStatementContext ? Collections.emptyList() : cursorStatementContext.getColumnSegments();
}
@Override
public Collection&lt;BinaryOperationExpression&gt; getJoinConditions() {
return null == cursorStatementContext ? Collections.emptyList() : cursorStatementContext.getJoinConditions();
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L510">510</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L291">291</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L490">490</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>new SubquerySegment(ctx.subquery().start.getStartIndex(), ctx.subquery().stop.getStopIndex(), (OracleSelectStatement) visit(ctx.subquery()), getOriginalText(ctx.subquery())));
}
String operator = null == ctx.SAFE_EQ_() ? ctx.comparisonOperator().getText() : ctx.SAFE_EQ_().getText();
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
@Override
public final ASTNode visitPredicate(final PredicateContext ctx) {
if (null != ctx.IN()) {
return createInSegment(ctx);
}
if (null != ctx.BETWEEN()) {
return createBetweenSegment(ctx);
}
if (null != ctx.LIKE()) {
return createBinaryOperationExpressionFromLike(ctx);
}
return visit(ctx.bitExpr(0));
}
private InExpression createInSegment(final PredicateContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.html#L1362">1362</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.html#L1387">1387</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public ASTNode visitIntoClause(final IntoClauseContext ctx) {
if (null != ctx.tableName()) {
SimpleTableSegment result = (SimpleTableSegment) visit(ctx.tableName());
if (null != ctx.alias()) {
result.setAlias((AliasSegment) visit(ctx.alias()));
}
return result;
}
if (null != ctx.viewName()) {
SimpleTableSegment result = (SimpleTableSegment) visit(ctx.viewName());
if (null != ctx.alias()) {
result.setAlias((AliasSegment) visit(ctx.alias()));
}
return result;
}
OracleSelectStatement subquery = (OracleSelectStatement) visit(ctx.subquery());
SubquerySegment subquerySegment = new SubquerySegment(ctx.subquery().start.getStartIndex(), ctx.subquery().stop.getStopIndex(), subquery, getOriginalText(ctx.subquery()));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L1390">1390</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L1340">1340</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>if (null != ctx.limitClause().selectFetchValue()) {
LimitValueSegment limit = (LimitValueSegment) visit(ctx.limitClause().selectFetchValue());
return new LimitSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), null, limit);
}
LimitValueSegment limit = (LimitValueSegment) visit(ctx.limitClause().selectLimitValue());
return new LimitSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), null, limit);
}
LimitValueSegment offset = (LimitValueSegment) visit(ctx.offsetClause().selectOffsetValue());
return new LimitSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), offset, null);
}
@Override
public ASTNode visitExecuteStmt(final ExecuteStmtContext ctx) {
return new OpenGaussExecuteStatement();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L266">266</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L397">397</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L266">266</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L390">390</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return new IndexSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), indexName);
}
@Override
public final ASTNode visitConstraintName(final ConstraintNameContext ctx) {
return new ConstraintSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), (IdentifierValue) visit(ctx.identifier()));
}
@Override
public final ASTNode visitTableNames(final TableNamesContext ctx) {
CollectionValue&lt;SimpleTableSegment&gt; result = new CollectionValue&lt;&gt;();
for (TableNameContext each : ctx.tableName()) {
result.getValue().add((SimpleTableSegment) visit(each));
}
return result;
}
@Override
public final ASTNode visitColumnNames(final ColumnNamesContext ctx) {
CollectionValue&lt;ColumnSegment&gt; result = new CollectionValue&lt;&gt;();
for (ColumnNameContext each : ctx.columnName()) {
result.getValue().add((ColumnSegment) visit(each));
}
return result;
}
@Override
public ASTNode visitAExpr(final AExprContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L864">864</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L977">977</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussDropSchemaStatement result = new OpenGaussDropSchemaStatement();
result.getSchemaNames().addAll(((CollectionValue&lt;IdentifierValue&gt;) visit(ctx.nameList())).getValue());
result.setContainsCascade(null != ctx.dropBehavior() &amp;&amp; null != ctx.dropBehavior().CASCADE());
return result;
}
@SuppressWarnings(&quot;unchecked&quot;)
@Override
public ASTNode visitNameList(final NameListContext ctx) {
CollectionValue&lt;IdentifierValue&gt; result = new CollectionValue&lt;&gt;();
if (null != ctx.nameList()) {
result.combine((CollectionValue&lt;IdentifierValue&gt;) visit(ctx.nameList()));
}
if (null != ctx.name()) {
result.getValue().add((IdentifierValue) visit(ctx.name()));
}
return result;
}
@Override
public ASTNode visitAlterLanguage(final AlterLanguageContext ctx) {
return new OpenGaussAlterLanguageStatement();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1404">1404</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1454">1454</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1475">1475</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>public ASTNode visitInsertValuesClause(final InsertValuesClauseContext ctx) {
MySQLInsertStatement result = new MySQLInsertStatement();
if (null != ctx.LP_()) {
if (null != ctx.fields()) {
result.setInsertColumns(new InsertColumnsSegment(ctx.LP_().getSymbol().getStartIndex(), ctx.RP_().getSymbol().getStopIndex(), createInsertColumns(ctx.fields())));
} else {
result.setInsertColumns(new InsertColumnsSegment(ctx.LP_().getSymbol().getStartIndex(), ctx.RP_().getSymbol().getStopIndex(), Collections.emptyList()));
}
} else {
result.setInsertColumns(new InsertColumnsSegment(ctx.start.getStartIndex() - 1, ctx.start.getStartIndex() - 1, Collections.emptyList()));
}
result.getValues().addAll(createInsertValuesSegments(ctx.assignmentValues()));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptGroupByItemTokenGenerator.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptGroupByItemTokenGenerator.html#L74">74</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptOrderByItemTokenGenerator.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptOrderByItemTokenGenerator.html#L67">67</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>for (OrderByItem each : getGroupByItems(sqlStatementContext)) {
if (each.getSegment() instanceof ColumnOrderByItemSegment) {
ColumnSegment columnSegment = ((ColumnOrderByItemSegment) each.getSegment()).getColumn();
Map&lt;String, String&gt; columnTableNames = sqlStatementContext.getTablesContext().findTableNamesByColumnSegment(Collections.singleton(columnSegment), schema);
result.addAll(generateSQLTokensWithColumnSegments(Collections.singleton(columnSegment), columnTableNames));
}
}
return result;
}
private Collection&lt;SubstitutableColumnNameToken&gt; generateSQLTokensWithColumnSegments(final Collection&lt;ColumnSegment&gt; columnSegments, final Map&lt;String, String&gt; columnTableNames) {
Collection&lt;SubstitutableColumnNameToken&gt; result = new LinkedList&lt;&gt;();
for (ColumnSegment each : columnSegments) {
String tableName = columnTableNames.getOrDefault(each.getExpression(), &quot;&quot;);
Optional&lt;EncryptTable&gt; encryptTable = encryptRule.findEncryptTable(tableName);
String columnName = each.getIdentifier().getValue();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/data/pipeline/opengauss/sqlbuilder/OpenGaussPipelineSQLBuilder.java</td>
<td>shardingsphere-data-pipeline-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/data/pipeline/opengauss/sqlbuilder/OpenGaussPipelineSQLBuilder.html#L48">48</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/PostgreSQLPipelineSQLBuilder.java</td>
<td>shardingsphere-data-pipeline-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/data/pipeline/postgresql/sqlbuilder/PostgreSQLPipelineSQLBuilder.html#L58">58</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>PipelineSQLSegmentBuilder sqlSegmentBuilder = new PipelineSQLSegmentBuilder(getType());
result.append(dataRecord.getColumns().stream()
.filter(each -&gt; !each.isUniqueKey()).map(each -&gt; sqlSegmentBuilder.getEscapedIdentifier(each.getName()) + &quot;=EXCLUDED.&quot; + sqlSegmentBuilder.getEscapedIdentifier(each.getName()))
.collect(Collectors.joining(&quot;,&quot;)));
return Optional.of(result.toString());
}
@Override
public String buildCheckEmptyTableSQL(final String qualifiedTableName) {
return String.format(&quot;SELECT * FROM %s LIMIT 1&quot;, qualifiedTableName);
}
@Override
public Optional&lt;String&gt; buildEstimatedCountSQL(final String qualifiedTableName) {
return Optional.of(String.format(&quot;SELECT reltuples::integer FROM pg_class WHERE oid='%s'::regclass::oid;&quot;, qualifiedTableName));
}
@Override
public Collection&lt;String&gt; buildCreateTableSQLs(final DataSource dataSource, final String schemaName, final String tableName) throws SQLException {
try (
Connection connection = dataSource.getConnection();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L763">763</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L886">886</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussPrepareStatement result = new OpenGaussPrepareStatement();
if (null != ctx.preparableStmt().select()) {
result.setSelect((SelectStatement) visit(ctx.preparableStmt().select()));
}
if (null != ctx.preparableStmt().insert()) {
result.setInsert((InsertStatement) visit(ctx.preparableStmt().insert()));
}
if (null != ctx.preparableStmt().update()) {
result.setUpdate((UpdateStatement) visit(ctx.preparableStmt().update()));
}
if (null != ctx.preparableStmt().delete()) {
result.setDelete((DeleteStatement) visit(ctx.preparableStmt().delete()));
}
return result;
}
@Override
public ASTNode visitDeallocate(final DeallocateContext ctx) {
return new OpenGaussDeallocateStatement();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/infra/binder/statement/dml/InsertStatementBinder.java</td>
<td>shardingsphere-infra-binder</td>
<td><a href="./xref/org/apache/shardingsphere/infra/binder/statement/dml/InsertStatementBinder.html#L66">66</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/infra/binder/statement/dml/MergeStatementBinder.java</td>
<td>shardingsphere-infra-binder</td>
<td><a href="./xref/org/apache/shardingsphere/infra/binder/statement/dml/MergeStatementBinder.html#L151">151</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>result.getValues().addAll(sqlStatement.getValues());
InsertStatementHandler.getOnDuplicateKeyColumnsSegment(sqlStatement).ifPresent(optional -&gt; InsertStatementHandler.setOnDuplicateKeyColumnsSegment(result, optional));
InsertStatementHandler.getSetAssignmentSegment(sqlStatement).ifPresent(optional -&gt; InsertStatementHandler.setSetAssignmentSegment(result, optional));
InsertStatementHandler.getWithSegment(sqlStatement).ifPresent(optional -&gt; InsertStatementHandler.setWithSegment(result, optional));
InsertStatementHandler.getOutputSegment(sqlStatement).ifPresent(optional -&gt; InsertStatementHandler.setOutputSegment(result, optional));
InsertStatementHandler.getMultiTableInsertType(sqlStatement).ifPresent(optional -&gt; InsertStatementHandler.setMultiTableInsertType(result, optional));
InsertStatementHandler.getMultiTableInsertIntoSegment(sqlStatement).ifPresent(optional -&gt; InsertStatementHandler.setMultiTableInsertIntoSegment(result, optional));
InsertStatementHandler.getMultiTableConditionalIntoSegment(sqlStatement).ifPresent(optional -&gt; InsertStatementHandler.setMultiTableConditionalIntoSegment(result, optional));
InsertStatementHandler.getReturningSegment(sqlStatement).ifPresent(optional -&gt; InsertStatementHandler.setReturningSegment(result, optional));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/traffic/yaml/swapper/YamlTrafficDataNodeRuleConfigurationSwapper.java</td>
<td>shardingsphere-traffic-core</td>
<td><a href="./xref/org/apache/shardingsphere/traffic/yaml/swapper/YamlTrafficDataNodeRuleConfigurationSwapper.html#L49">49</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/traffic/yaml/swapper/YamlTrafficRuleConfigurationSwapper.java</td>
<td>shardingsphere-traffic-core</td>
<td><a href="./xref/org/apache/shardingsphere/traffic/yaml/swapper/YamlTrafficRuleConfigurationSwapper.html#L39">39</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private YamlTrafficRuleConfiguration swapToYamlConfiguration(final TrafficRuleConfiguration data) {
YamlTrafficRuleConfiguration result = new YamlTrafficRuleConfiguration();
data.getTrafficStrategies().forEach(each -&gt; result.getTrafficStrategies().put(each.getName(), strategySwapper.swapToYamlConfiguration(each)));
setYamlAlgorithms(data, result);
return result;
}
private void setYamlAlgorithms(final TrafficRuleConfiguration data, final YamlTrafficRuleConfiguration yamlConfig) {
if (null != data.getTrafficAlgorithms()) {
data.getTrafficAlgorithms().forEach((key, value) -&gt; yamlConfig.getTrafficAlgorithms().put(key, algorithmSwapper.swapToYamlConfiguration(value)));
}
if (null != data.getLoadBalancers()) {
data.getLoadBalancers().forEach((key, value) -&gt; yamlConfig.getLoadBalancers().put(key, algorithmSwapper.swapToYamlConfiguration(value)));
}
}
@Override
public Optional&lt;TrafficRuleConfiguration&gt; swapToObject(final Collection&lt;YamlDataNode&gt; dataNodes) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L574">574</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L712">712</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussAlterIndexStatement result = new OpenGaussAlterIndexStatement();
result.setIndex(createIndexSegment((SimpleTableSegment) visit(ctx.qualifiedName())));
if (null != ctx.alterIndexDefinitionClause().renameIndexSpecification()) {
result.setRenameIndex((IndexSegment) visit(ctx.alterIndexDefinitionClause().renameIndexSpecification().indexName()));
}
return result;
}
private IndexSegment createIndexSegment(final SimpleTableSegment tableSegment) {
IndexNameSegment indexName = new IndexNameSegment(tableSegment.getTableName().getStartIndex(), tableSegment.getTableName().getStopIndex(), tableSegment.getTableName().getIdentifier());
IndexSegment result = new IndexSegment(tableSegment.getStartIndex(), tableSegment.getStopIndex(), indexName);
tableSegment.getOwner().ifPresent(result::setOwner);
return result;
}
@SuppressWarnings(&quot;unchecked&quot;)
@Override
public ASTNode visitDropIndex(final DropIndexContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/infra/metadata/statistics/builder/dialect/MySQLShardingSphereStatisticsBuilder.java</td>
<td>shardingsphere-infra-common</td>
<td><a href="./xref/org/apache/shardingsphere/infra/metadata/statistics/builder/dialect/MySQLShardingSphereStatisticsBuilder.html#L46">46</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/infra/metadata/statistics/builder/dialect/PostgreSQLShardingSphereStatisticsBuilder.java</td>
<td>shardingsphere-infra-common</td>
<td><a href="./xref/org/apache/shardingsphere/infra/metadata/statistics/builder/dialect/PostgreSQLShardingSphereStatisticsBuilder.html#L57">57</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>@Override
public ShardingSphereStatistics build(final ShardingSphereMetaData metaData) {
ShardingSphereStatistics result = new ShardingSphereStatistics();
for (Entry&lt;String, ShardingSphereDatabase&gt; entry : metaData.getDatabases().entrySet()) {
ShardingSphereDatabaseData databaseData = new ShardingSphereDatabaseData();
initSchemas(entry.getValue(), databaseData);
if (!databaseData.getSchemaData().isEmpty()) {
result.putDatabase(entry.getKey(), databaseData);
}
}
return result;
}
private void initSchemas(final ShardingSphereDatabase database, final ShardingSphereDatabaseData databaseData) {
for (Entry&lt;String, ShardingSphereSchema&gt; entry : database.getSchemas().entrySet()) {
if (SHARDING_SPHERE.equals(entry.getKey())) {
ShardingSphereSchemaData schemaData = new ShardingSphereSchemaData();
initClusterInformationTable(schemaData);
initShardingTableStatisticsTable(schemaData);
databaseData.putSchema(SHARDING_SPHERE, schemaData);
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1650">1650</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.html#L260">260</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return new BooleanLiteralValue(false);
}
@Override
public ASTNode visitProjections(final ProjectionsContext ctx) {
Collection&lt;ProjectionSegment&gt; projections = new LinkedList&lt;&gt;();
if (null != ctx.unqualifiedShorthand()) {
projections.add(new ShorthandProjectionSegment(ctx.unqualifiedShorthand().getStart().getStartIndex(), ctx.unqualifiedShorthand().getStop().getStopIndex()));
}
for (ProjectionContext each : ctx.projection()) {
projections.add((ProjectionSegment) visit(each));
}
ProjectionsSegment result = new ProjectionsSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex());
result.getProjections().addAll(projections);
return result;
}
@Override
public ASTNode visitProjection(final ProjectionContext ctx) {
// FIXME :The stop index of project is the stop index of projection, instead of alias.
if (null != ctx.qualifiedShorthand()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L498">498</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L291">291</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L490">490</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>new SubquerySegment(ctx.subquery().start.getStartIndex(), ctx.subquery().stop.getStopIndex(), (MySQLSelectStatement) visit(ctx.subquery()), getOriginalText(ctx.subquery())));
}
String operator = null == ctx.SAFE_EQ_() ? ctx.comparisonOperator().getText() : ctx.SAFE_EQ_().getText();
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
@Override
public final ASTNode visitPredicate(final PredicateContext ctx) {
if (null != ctx.IN()) {
return createInSegment(ctx);
}
if (null != ctx.BETWEEN()) {
return createBetweenSegment(ctx);
}
if (null != ctx.LIKE()) {
return createBinaryOperationExpressionFromLike(ctx);
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.html#L443">443</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L1642">1642</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return JoinType.RIGHT.name();
} else if (null != ctx.INNER()) {
return JoinType.INNER.name();
} else if (null != ctx.CROSS()) {
return JoinType.CROSS.name();
}
return JoinType.INNER.name();
}
private void visitJoinSpecification(final JoinSpecificationContext ctx, final JoinTableSegment joinTableSource) {
if (null != ctx.expr()) {
ExpressionSegment condition = (ExpressionSegment) visit(ctx.expr());
joinTableSource.setCondition(condition);
}
if (null != ctx.USING()) {
joinTableSource.setUsing(ctx.columnNames().columnName().stream().map(each -&gt; (ColumnSegment) visit(each)).collect(Collectors.toList()));
}
}
@Override
public ASTNode visitWhereClause(final WhereClauseContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/data/pipeline/migration/distsql/parser/core/MigrationDistSQLStatementVisitor.java</td>
<td>shardingsphere-data-pipeline-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/data/pipeline/migration/distsql/parser/core/MigrationDistSQLStatementVisitor.html#L233">233</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java</td>
<td>shardingsphere-parser-distsql-engine</td>
<td><a href="./xref/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.html#L129">129</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public ASTNode visitStorageUnitDefinition(final MigrationDistSQLStatementParser.StorageUnitDefinitionContext ctx) {
String user = getIdentifierValue(ctx.user());
String password = null == ctx.password() ? &quot;&quot; : getPassword(ctx.password());
Properties props = getProperties(ctx.propertiesDefinition());
return null == ctx.urlSource()
? new HostnameAndPortBasedDataSourceSegment(getIdentifierValue(ctx.storageUnitName()),
getIdentifierValue(ctx.simpleSource().hostname()), ctx.simpleSource().port().getText(), getIdentifierValue(ctx.simpleSource().dbName()), user, password, props)
: new URLBasedDataSourceSegment(getIdentifierValue(ctx.storageUnitName()), getIdentifierValue(ctx.urlSource().url()), user, password, props);
}
private String getPassword(final PasswordContext ctx) {
return getIdentifierValue(ctx);</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L662">662</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L662">662</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L535">535</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L915">915</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
@Override
public final ASTNode visitDataType(final DataTypeContext ctx) {
DataTypeSegment result = new DataTypeSegment();
result.setDataTypeName(((KeywordValue) visit(ctx.dataTypeName())).getValue());
result.setStartIndex(ctx.start.getStartIndex());
result.setStopIndex(ctx.stop.getStopIndex());
if (null != ctx.dataTypeLength()) {
DataTypeLengthSegment dataTypeLengthSegment = (DataTypeLengthSegment) visit(ctx.dataTypeLength());
result.setDataLength(dataTypeLengthSegment);
}
return result;
}
@Override
public final ASTNode visitDataTypeLength(final DataTypeLengthContext ctx) {
DataTypeLengthSegment result = new DataTypeLengthSegment();
result.setStartIndex(ctx.start.getStartIndex());
result.setStopIndex(ctx.stop.getStartIndex());
List&lt;TerminalNode&gt; numbers = ctx.NUMBER_();
if (1 == numbers.size()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDALStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDALStatementVisitor.html#L115">115</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDALStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDALStatementVisitor.html#L122">122</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussAnalyzeTableStatement result = new OpenGaussAnalyzeTableStatement();
if (null != ctx.vacuumRelationList()) {
result.getTables().addAll(((CollectionValue&lt;SimpleTableSegment&gt;) visit(ctx.vacuumRelationList())).getValue());
}
return result;
}
@Override
public ASTNode visitVacuumRelationList(final VacuumRelationListContext ctx) {
CollectionValue&lt;SimpleTableSegment&gt; result = new CollectionValue&lt;&gt;();
for (VacuumRelationContext each : ctx.vacuumRelation()) {
ColIdContext colId = each.qualifiedName().colId();
TableNameSegment tableName = new TableNameSegment(colId.start.getStartIndex(), colId.stop.getStopIndex(), new IdentifierValue(colId.getText()));
result.getValue().add(new SimpleTableSegment(tableName));
}
return result;
}
@Override
public ASTNode visitLoad(final LoadContext ctx) {
return new OpenGaussLoadStatement();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/agent/plugin/core/util/AgentReflectionUtils.java</td>
<td>shardingsphere-agent-plugin-core</td>
<td><a href="./xref/org/apache/shardingsphere/agent/plugin/core/util/AgentReflectionUtils.html#L47">47</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/infra/util/reflection/ReflectionUtils.java</td>
<td>shardingsphere-infra-util</td>
<td><a href="./xref/org/apache/shardingsphere/infra/util/reflection/ReflectionUtils.html#L46">46</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>throw new IllegalStateException(String.format(&quot;Can not find field name `%s` in class %s.&quot;, fieldName, target.getClass()));
}
@SuppressWarnings(&quot;unchecked&quot;)
@SneakyThrows(IllegalAccessException.class)
private static &lt;T&gt; T getFieldValue(final Object target, final Field field) {
boolean accessible = field.isAccessible();
if (!accessible) {
field.setAccessible(true);
}
T result = (T) field.get(target);
if (!accessible) {
field.setAccessible(false);
}
return result;
}
private static Optional&lt;Field&gt; findField(final String fieldName, final Class&lt;?&gt; targetClass) {
Class&lt;?&gt; currentTargetClass = targetClass;
while (Object.class != currentTargetClass) {
try {
return Optional.of(currentTargetClass.getDeclaredField(fieldName));
} catch (final NoSuchFieldException ignored) {
currentTargetClass = currentTargetClass.getSuperclass();
}
}
return Optional.empty();
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/distsql/parser/core/EncryptDistSQLStatementVisitor.java</td>
<td>shardingsphere-encrypt-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/distsql/parser/core/EncryptDistSQLStatementVisitor.html#L105">105</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/mask/distsql/parser/core/MaskDistSQLStatementVisitor.java</td>
<td>shardingsphere-mask-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/mask/distsql/parser/core/MaskDistSQLStatementVisitor.html#L89">89</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return null == ctx.likeQueryAlgorithm() ? null : (AlgorithmSegment) visit(ctx.likeQueryAlgorithm().algorithmDefinition());
}
@Override
public ASTNode visitAlgorithmDefinition(final AlgorithmDefinitionContext ctx) {
return new AlgorithmSegment(getIdentifierValue(ctx.algorithmTypeName()), getProperties(ctx.propertiesDefinition()));
}
private String getIdentifierValue(final ParseTree context) {
return null == context ? null : new IdentifierValue(context.getText()).getValue();
}
private Properties getProperties(final PropertiesDefinitionContext ctx) {
Properties result = new Properties();
if (null == ctx || null == ctx.properties()) {
return result;
}
for (PropertyContext each : ctx.properties().property()) {
result.setProperty(IdentifierValue.getQuotedContent(each.key.getText()), IdentifierValue.getQuotedContent(each.value.getText()));
}
return result;
}
@Override
public ASTNode visitTableName(final TableNameContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/mask/algorithm/cover/MaskAfterSpecialCharsAlgorithm.java</td>
<td>shardingsphere-mask-core</td>
<td><a href="./xref/org/apache/shardingsphere/mask/algorithm/cover/MaskAfterSpecialCharsAlgorithm.html#L29">29</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/mask/algorithm/cover/MaskBeforeSpecialCharsAlgorithm.java</td>
<td>shardingsphere-mask-core</td>
<td><a href="./xref/org/apache/shardingsphere/mask/algorithm/cover/MaskBeforeSpecialCharsAlgorithm.html#L29">29</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final class MaskAfterSpecialCharsAlgorithm implements MaskAlgorithm&lt;Object, String&gt; {
private static final String SPECIAL_CHARS = &quot;special-chars&quot;;
private static final String REPLACE_CHAR = &quot;replace-char&quot;;
private String specialChars;
private Character replaceChar;
@Override
public void init(final Properties props) {
specialChars = createSpecialChars(props);
replaceChar = createReplaceChar(props);
}
private String createSpecialChars(final Properties props) {
MaskAlgorithmPropertiesChecker.checkAtLeastOneChar(props, SPECIAL_CHARS, this);
return props.getProperty(SPECIAL_CHARS);
}
private Character createReplaceChar(final Properties props) {
MaskAlgorithmPropertiesChecker.checkSingleChar(props, REPLACE_CHAR, this);
return props.getProperty(REPLACE_CHAR).charAt(0);
}
@Override
public String mask(final Object plainValue) {
String result = null == plainValue ? null : String.valueOf(plainValue);
if (Strings.isNullOrEmpty(result)) {
return result;
}
int index = result.contains(specialChars) ? result.indexOf(specialChars) + specialChars.length() : -1;</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDALStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDALStatementVisitor.html#L89">89</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDALStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDALStatementVisitor.html#L96">96</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return result;
}
@Override
public ASTNode visitConfigurationParameterClause(final ConfigurationParameterClauseContext ctx) {
VariableAssignSegment result = new VariableAssignSegment();
result.setStartIndex(ctx.start.getStartIndex());
result.setStopIndex(ctx.stop.getStopIndex());
result.setVariable(new VariableSegment(ctx.varName().start.getStartIndex(), ctx.varName().stop.getStopIndex(), ctx.varName().getText()));
if (null != ctx.varList()) {
result.setAssignValue(ctx.varList().getText());
}
if (null != ctx.DEFAULT()) {
result.setAssignValue(ctx.DEFAULT().getText());
}
return result;
}
@Override
public ASTNode visitResetParameter(final ResetParameterContext ctx) {
return new OpenGaussResetParameterStatement(null != ctx.ALL() ? &quot;ALL&quot; : ctx.identifier().getText());</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java</td>
<td>shardingsphere-jdbc</td>
<td><a href="./xref/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.html#L287">287</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java</td>
<td>shardingsphere-jdbc</td>
<td><a href="./xref/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.html#L205">205</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return context.getInputGroups().iterator().next().getInputs().iterator().next();
}
private Optional&lt;String&gt; getInstanceIdAndSet(final QueryContext queryContext) {
Optional&lt;String&gt; result = connection.getDatabaseConnectionManager().getConnectionContext().getTrafficInstanceId();
if (!result.isPresent()) {
result = getInstanceId(queryContext);
}
if (connection.isHoldTransaction() &amp;&amp; result.isPresent()) {
connection.getDatabaseConnectionManager().getConnectionContext().setTrafficInstanceId(result.get());
}
return result;
}
private Optional&lt;String&gt; getInstanceId(final QueryContext queryContext) {
InstanceContext instanceContext = connection.getContextManager().getInstanceContext();
return null != trafficRule &amp;&amp; !trafficRule.getStrategyRules().isEmpty()
? new TrafficEngine(trafficRule, instanceContext).dispatch(queryContext, connection.isHoldTransaction())
: Optional.empty();
}
private void resetParameters() throws SQLException {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/rule/column/item/AssistedQueryColumnItem.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rule/column/item/AssistedQueryColumnItem.html#L33">33</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/encrypt/rule/column/item/CipherColumnItem.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rule/column/item/CipherColumnItem.html#L33">33</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final class AssistedQueryColumnItem {
private final String name;
private final EncryptAlgorithm encryptor;
/**
* Get encrypt assisted query value.
*
* @param databaseName database name
* @param schemaName schema name
* @param tableName table name
* @param logicColumnName logic column name
* @param originalValue original value
* @return assisted query values
*/
public Object encrypt(final String databaseName, final String schemaName, final String tableName, final String logicColumnName, final Object originalValue) {
if (null == originalValue) {
return null;
}
return encryptor.encrypt(originalValue, new AlgorithmSQLContext(databaseName, schemaName, tableName, logicColumnName));
}
/**
* Get encrypt assisted query values.
*
* @param databaseName database name
* @param schemaName schema name
* @param tableName table name
* @param logicColumnName logic column name
* @param originalValues original values
* @return assisted query values
*/
public List&lt;Object&gt; encrypt(final String databaseName, final String schemaName, final String tableName, final String logicColumnName, final List&lt;Object&gt; originalValues) {
AlgorithmSQLContext algorithmSQLContext = new AlgorithmSQLContext(databaseName, schemaName, tableName, logicColumnName);
List&lt;Object&gt; result = new LinkedList&lt;&gt;();
for (Object each : originalValues) {
result.add(null == each ? null : encryptor.encrypt(each, algorithmSQLContext));
}
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/rule/column/item/AssistedQueryColumnItem.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rule/column/item/AssistedQueryColumnItem.html#L35">35</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/encrypt/rule/column/item/LikeQueryColumnItem.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rule/column/item/LikeQueryColumnItem.html#L35">35</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private final String name;
private final EncryptAlgorithm encryptor;
/**
* Get encrypt assisted query value.
*
* @param databaseName database name
* @param schemaName schema name
* @param tableName table name
* @param logicColumnName logic column name
* @param originalValue original value
* @return assisted query values
*/
public Object encrypt(final String databaseName, final String schemaName, final String tableName, final String logicColumnName, final Object originalValue) {
if (null == originalValue) {
return null;
}
return encryptor.encrypt(originalValue, new AlgorithmSQLContext(databaseName, schemaName, tableName, logicColumnName));
}
/**
* Get encrypt assisted query values.
*
* @param databaseName database name
* @param schemaName schema name
* @param tableName table name
* @param logicColumnName logic column name
* @param originalValues original values
* @return assisted query values
*/
public List&lt;Object&gt; encrypt(final String databaseName, final String schemaName, final String tableName, final String logicColumnName, final List&lt;Object&gt; originalValues) {
AlgorithmSQLContext algorithmSQLContext = new AlgorithmSQLContext(databaseName, schemaName, tableName, logicColumnName);
List&lt;Object&gt; result = new LinkedList&lt;&gt;();
for (Object each : originalValues) {
result.add(null == each ? null : encryptor.encrypt(each, algorithmSQLContext));
}
return result;
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1384">1384</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1405">1405</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1455">1455</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1476">1476</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>result.setInsertSelect(createInsertSelectSegment(ctx));
if (null != ctx.LP_()) {
if (null != ctx.fields()) {
result.setInsertColumns(new InsertColumnsSegment(ctx.LP_().getSymbol().getStartIndex(), ctx.RP_().getSymbol().getStopIndex(), createInsertColumns(ctx.fields())));
} else {
result.setInsertColumns(new InsertColumnsSegment(ctx.LP_().getSymbol().getStartIndex(), ctx.RP_().getSymbol().getStopIndex(), Collections.emptyList()));
}
} else {
result.setInsertColumns(new InsertColumnsSegment(ctx.start.getStartIndex() - 1, ctx.start.getStartIndex() - 1, Collections.emptyList()));
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/rule/column/item/CipherColumnItem.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rule/column/item/CipherColumnItem.html#L35">35</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/encrypt/rule/column/item/LikeQueryColumnItem.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rule/column/item/LikeQueryColumnItem.html#L35">35</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private final String name;
private final EncryptAlgorithm encryptor;
/**
* Encrypt.
*
* @param databaseName database name
* @param schemaName schema name
* @param tableName table name
* @param logicColumnName logic column name
* @param originalValue original value
* @return encrypted value
*/
public Object encrypt(final String databaseName, final String schemaName, final String tableName, final String logicColumnName, final Object originalValue) {
if (null == originalValue) {
return null;
}
return encryptor.encrypt(originalValue, new AlgorithmSQLContext(databaseName, schemaName, tableName, logicColumnName));
}
/**
* Encrypt.
*
* @param databaseName database name
* @param schemaName schema name
* @param tableName table name
* @param logicColumnName logic column name
* @param originalValues original values
* @return encrypted values
*/
public List&lt;Object&gt; encrypt(final String databaseName, final String schemaName, final String tableName, final String logicColumnName, final List&lt;Object&gt; originalValues) {
AlgorithmSQLContext algorithmSQLContext = new AlgorithmSQLContext(databaseName, schemaName, tableName, logicColumnName);
List&lt;Object&gt; result = new LinkedList&lt;&gt;();
for (Object each : originalValues) {
result.add(null == each ? null : encryptor.encrypt(each, algorithmSQLContext));
}
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/AssociateStatisticsStatementTestCase.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/AssociateStatisticsStatementTestCase.html#L40">40</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/DisassociateStatisticsStatementTestCase.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/DisassociateStatisticsStatementTestCase.html#L40">40</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final class AssociateStatisticsStatementTestCase extends SQLParserTestCase {
@XmlElement(name = &quot;index&quot;)
private final List&lt;ExpectedIndex&gt; indexes = new LinkedList&lt;&gt;();
@XmlElement(name = &quot;table&quot;)
private final List&lt;ExpectedSimpleTable&gt; tables = new LinkedList&lt;&gt;();
@XmlElement(name = &quot;column&quot;)
private final List&lt;ExpectedColumn&gt; columns = new LinkedList&lt;&gt;();
@XmlElement(name = &quot;function&quot;)
private final List&lt;ExpectedFunction&gt; functions = new LinkedList&lt;&gt;();
@XmlElement(name = &quot;package&quot;)
private final List&lt;ExpectedPackage&gt; packages = new LinkedList&lt;&gt;();
@XmlElement(name = &quot;type&quot;)
private final List&lt;ExpectedType&gt; types = new LinkedList&lt;&gt;();
@XmlElement(name = &quot;index-type&quot;)
private final List&lt;ExpectedIndexType&gt; indexTypes = new LinkedList&lt;&gt;();
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/AlterStorageUnitStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/AlterStorageUnitStatementAssert.html#L54">54</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/RegisterStorageUnitStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/RegisterStorageUnitStatementAssert.html#L55">55</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>assertNotNull(actual, assertContext.getText(&quot;Actual statement should exist.&quot;));
assertDataSources(assertContext, actual.getStorageUnits(), expected.getDataSources());
}
}
private static void assertDataSources(final SQLCaseAssertContext assertContext, final Collection&lt;DataSourceSegment&gt; actual, final List&lt;ExpectedDataSource&gt; expected) {
if (null == expected) {
assertNull(actual, assertContext.getText(&quot;Actual storage unit should not exist.&quot;));
} else {
assertNotNull(actual, assertContext.getText(&quot;Actual storage unit should exist.&quot;));
assertThat(assertContext.getText(String.format(&quot;Actual storage unit size should be %s , but it was %s&quot;, expected.size(), actual.size())), actual.size(), is(expected.size()));
int count = 0;
for (DataSourceSegment each : actual) {
DataSourceAssert.assertIs(assertContext, each, expected.get(count));
count++;
}
}
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/infra/connection/refresher/type/table/AlterTableStatementSchemaRefresher.java</td>
<td>shardingsphere-infra-context</td>
<td><a href="./xref/org/apache/shardingsphere/infra/connection/refresher/type/table/AlterTableStatementSchemaRefresher.html#L65">65</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/infra/connection/refresher/type/table/RenameTableStatementSchemaRefresher.java</td>
<td>shardingsphere-infra-context</td>
<td><a href="./xref/org/apache/shardingsphere/infra/connection/refresher/type/table/RenameTableStatementSchemaRefresher.html#L63">63</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>if (TableRefreshUtils.isSingleTable(tableName, database)) {
ruleMetaData.getAttributes(MutableDataNodeRuleAttribute.class).forEach(each -&gt; each.put(logicDataSourceNames.iterator().next(), schemaName, tableName));
}
GenericSchemaBuilderMaterial material = new GenericSchemaBuilderMaterial(
database.getProtocolType(), database.getResourceMetaData().getStorageUnits(), ruleMetaData.getRules(), props, schemaName);
Map&lt;String, ShardingSphereSchema&gt; schemaMap = GenericSchemaBuilder.build(Collections.singletonList(tableName), material);
return Optional.ofNullable(schemaMap.get(schemaName)).map(optional -&gt; optional.getTable(tableName))
.orElseGet(() -&gt; new ShardingSphereTable(tableName, Collections.emptyList(), Collections.emptyList(), Collections.emptyList()));
}
@Override
public Class&lt;AlterTableStatement&gt; getType() {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L219">219</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L117">117</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L256">256</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>return new ParameterMarkerValue(globalParameterMarkerSegments.size(), ParameterMarkerType.QUESTION);
}
@Override
public final ASTNode visitLiterals(final LiteralsContext ctx) {
if (null != ctx.stringLiterals()) {
return visit(ctx.stringLiterals());
}
if (null != ctx.numberLiterals()) {
return visit(ctx.numberLiterals());
}
if (null != ctx.hexadecimalLiterals()) {
return visit(ctx.hexadecimalLiterals());
}
if (null != ctx.bitValueLiterals()) {
return visit(ctx.bitValueLiterals());
}
if (null != ctx.booleanLiterals()) {
return visit(ctx.booleanLiterals());
}
if (null != ctx.nullValueLiterals()) {
return visit(ctx.nullValueLiterals());
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.html#L532">532</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.html#L154">154</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OracleAlterTableStatement result = new OracleAlterTableStatement();
result.setTable((SimpleTableSegment) visit(ctx.tableName()));
if (null != ctx.alterDefinitionClause()) {
for (AlterDefinitionSegment each : ((CollectionValue&lt;AlterDefinitionSegment&gt;) visit(ctx.alterDefinitionClause())).getValue()) {
if (each instanceof AddColumnDefinitionSegment) {
result.getAddColumnDefinitions().add((AddColumnDefinitionSegment) each);
} else if (each instanceof ModifyColumnDefinitionSegment) {
result.getModifyColumnDefinitions().add((ModifyColumnDefinitionSegment) each);
} else if (each instanceof DropColumnDefinitionSegment) {
result.getDropColumnDefinitions().add((DropColumnDefinitionSegment) each);
} else if (each instanceof AddConstraintDefinitionSegment) {
result.getAddConstraintDefinitions().add((AddConstraintDefinitionSegment) each);
} else if (each instanceof ModifyConstraintDefinitionSegment) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/impl/AlterReadwriteSplittingRuleStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/impl/AlterReadwriteSplittingRuleStatementAssert.html#L53">53</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/impl/CreateReadwriteSplittingRuleStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/impl/CreateReadwriteSplittingRuleStatementAssert.html#L54">54</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>assertReadwriteSplittingRule(assertContext, actual.getRules(), expected.getRules());
}
}
private static void assertReadwriteSplittingRule(final SQLCaseAssertContext assertContext, final Collection&lt;ReadwriteSplittingRuleSegment&gt; actual,
final List&lt;ExceptedReadwriteSplittingRule&gt; expected) {
if (null == expected) {
assertNull(actual, assertContext.getText(&quot;Actual readwrite-splitting rule should not exist.&quot;));
} else {
assertNotNull(actual, assertContext.getText(&quot;Actual readwrite-splitting rule should exist.&quot;));
assertThat(assertContext.getText(String.format(&quot;Actual readwrite-splitting rule size should be %s , but it was %s&quot;, expected.size(), actual.size())), actual.size(), is(expected.size()));
int count = 0;
for (ReadwriteSplittingRuleSegment each : actual) {
ReadwriteSplittingRuleAssert.assertIs(assertContext, each, expected.get(count));
count++;
}
}
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/impl/AlterShardingTableReferenceRulesStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/impl/AlterShardingTableReferenceRulesStatementAssert.html#L53">53</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/impl/CreateShardingTableReferenceRuleStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/impl/CreateShardingTableReferenceRuleStatementAssert.html#L54">54</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>assertShardingBindingTableRules(assertContext, actual.getRules(), expected.getRules());
}
}
private static void assertShardingBindingTableRules(final SQLCaseAssertContext assertContext, final Collection&lt;TableReferenceRuleSegment&gt; actual,
final List&lt;ExpectedShardingTableReferenceRule&gt; expected) {
if (null == expected) {
assertNull(actual, assertContext.getText(&quot;Actual sharding table reference rule should not exist.&quot;));
} else {
assertNotNull(actual, assertContext.getText(&quot;Actual sharding table reference rule should exist.&quot;));
assertThat(assertContext.getText(String.format(&quot;Actual sharding table reference rule size should be %s , but it was %s&quot;, expected.size(), actual.size())),
actual.size(), is(expected.size()));
int count = 0;
for (TableReferenceRuleSegment each : actual) {
ShardingTableReferenceRuleAssert.assertIs(assertContext, each, expected.get(count));
count++;
}
}
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L954">954</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L987">987</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>protected Collection&lt;ExpressionSegment&gt; getExpressions(final List&lt;ExprContext&gt; exprList) {
if (null == exprList) {
return Collections.emptyList();
}
Collection&lt;ExpressionSegment&gt; result = new ArrayList&lt;&gt;(exprList.size());
for (ExprContext each : exprList) {
result.add((ExpressionSegment) visit(each));
}
return result;
}
private String getDistinctExpression(final AggregationFunctionContext ctx) {
StringBuilder result = new StringBuilder();
for (int i = 3; i &lt; ctx.getChildCount() - 1; i++) {
result.append(ctx.getChild(i).getText());
}
return result.toString();
}
@Override
public final ASTNode visitSpecialFunction(final SpecialFunctionContext ctx) {
if (null != ctx.groupConcatFunction()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDCLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDCLStatementVisitor.html#L61">61</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDCLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDCLStatementVisitor.html#L65">65</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussRevokeStatement result = new OpenGaussRevokeStatement();
if (containsTableSegment(ctx.privilegeClause())) {
result.getTables().addAll(getTableSegments(ctx.privilegeClause()));
}
return result;
}
private boolean containsTableSegment(final PrivilegeClauseContext ctx) {
return null != ctx &amp;&amp; null != ctx.onObjectClause() &amp;&amp; null != ctx.onObjectClause().privilegeLevel() &amp;&amp; null != ctx.onObjectClause().privilegeLevel().tableNames();
}
@SuppressWarnings(&quot;unchecked&quot;)
private Collection&lt;SimpleTableSegment&gt; getTableSegments(final PrivilegeClauseContext ctx) {
return ((CollectionValue&lt;SimpleTableSegment&gt;) visit(ctx.onObjectClause().privilegeLevel().tableNames())).getValue();
}
@Override
public ASTNode visitCreateUser(final CreateUserContext ctx) {
return new OpenGaussCreateUserStatement();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/rewrite/token/pojo/EncryptPredicateFunctionRightValueToken.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rewrite/token/pojo/EncryptPredicateFunctionRightValueToken.html#L54">54</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/encrypt/rewrite/token/pojo/EncryptPredicateInRightValueToken.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rewrite/token/pojo/EncryptPredicateInRightValueToken.html#L50">50</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>result.append(functionName).append(&quot; (&quot;);
for (int i = 0; i &lt; indexValues.size() + paramMarkerIndexes.size(); i++) {
if (paramMarkerIndexes.contains(i)) {
result.append('?');
} else {
if (indexValues.get(i) instanceof String) {
result.append('\'').append(indexValues.get(i)).append('\'');
} else {
result.append(indexValues.get(i));
}
}
result.append(&quot;, &quot;);
}
result.delete(result.length() - 2, result.length()).append(')');
return result.toString();
}
@Override
public boolean equals(final Object obj) {
return obj instanceof EncryptPredicateFunctionRightValueToken &amp;&amp; ((EncryptPredicateFunctionRightValueToken) obj).getStartIndex() == getStartIndex()</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1831">1831</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.html#L407">407</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>MySQLSelectStatement subquery = (MySQLSelectStatement) visit(ctx.subquery());
SubquerySegment subquerySegment = new SubquerySegment(ctx.subquery().start.getStartIndex(), ctx.subquery().stop.getStopIndex(), subquery, getOriginalText(ctx.subquery()));
SubqueryTableSegment result = new SubqueryTableSegment(subquerySegment);
if (null != ctx.alias()) {
result.setAlias((AliasSegment) visit(ctx.alias()));
}
return result;
}
if (null != ctx.tableName()) {
SimpleTableSegment result = (SimpleTableSegment) visit(ctx.tableName());
if (null != ctx.alias()) {
result.setAlias((AliasSegment) visit(ctx.alias()));
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/impl/AlterEncryptRuleStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/impl/AlterEncryptRuleStatementAssert.html#L53">53</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/impl/CreateEncryptRuleStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/impl/CreateEncryptRuleStatementAssert.html#L54">54</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>assertEncryptRules(assertContext, actual.getRules(), expected.getRules());
}
}
private static void assertEncryptRules(final SQLCaseAssertContext assertContext, final Collection&lt;EncryptRuleSegment&gt; actual, final List&lt;ExpectedEncryptRule&gt; expected) {
if (null == expected) {
assertNull(actual, assertContext.getText(&quot;Actual encrypt rule should not exist.&quot;));
} else {
assertNotNull(actual, assertContext.getText(&quot;Actual encrypt rule should exist.&quot;));
assertThat(assertContext.getText(String.format(&quot;Actual encrypt rule size should be %s , but it was %s&quot;, expected.size(), actual.size())), actual.size(), is(expected.size()));
int count = 0;
for (EncryptRuleSegment each : actual) {
ExpectedEncryptRule expectedEncryptRule = expected.get(count);
assertThat(assertContext.getText(&quot;encrypt rule table name assertion error: &quot;), each.getTableName(), is(expectedEncryptRule.getName()));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L528">528</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L519">519</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return visit(ctx.bitExpr(0));
}
private InExpression createInSegment(final PredicateContext ctx) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.bitExpr(0));
ExpressionSegment right;
if (null == ctx.subquery()) {
ListExpression listExpression = new ListExpression(ctx.LP_().getSymbol().getStartIndex(), ctx.RP_().getSymbol().getStopIndex());
for (ExprContext each : ctx.expr()) {
listExpression.getItems().add((ExpressionSegment) visit(each));
}
right = listExpression;
} else {
right = new SubqueryExpressionSegment(
new SubquerySegment(ctx.subquery().start.getStartIndex(), ctx.subquery().stop.getStopIndex(), (OracleSelectStatement) visit(ctx.subquery()), getOriginalText(ctx.subquery())));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/infra/binder/context/statement/ddl/CloseStatementContext.java</td>
<td>shardingsphere-infra-binder</td>
<td><a href="./xref/org/apache/shardingsphere/infra/binder/context/statement/ddl/CloseStatementContext.html#L59">59</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/infra/binder/context/statement/ddl/FetchStatementContext.java</td>
<td>shardingsphere-infra-binder</td>
<td><a href="./xref/org/apache/shardingsphere/infra/binder/context/statement/ddl/FetchStatementContext.html#L59">59</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/infra/binder/context/statement/ddl/MoveStatementContext.java</td>
<td>shardingsphere-infra-binder</td>
<td><a href="./xref/org/apache/shardingsphere/infra/binder/context/statement/ddl/MoveStatementContext.html#L59">59</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>return getSqlStatement().getCursorName();
}
@Override
public void setUpCursorDefinition(final CursorStatementContext cursorStatementContext) {
this.cursorStatementContext = cursorStatementContext;
TableExtractor tableExtractor = new TableExtractor();
tableExtractor.extractTablesFromSelect(cursorStatementContext.getSqlStatement().getSelect());
tablesContext = new TablesContext(tableExtractor.getRewriteTables(), getDatabaseType());
}
@Override
public Collection&lt;WhereSegment&gt; getWhereSegments() {
return null == cursorStatementContext ? Collections.emptyList() : cursorStatementContext.getWhereSegments();
}
@Override
public Collection&lt;ColumnSegment&gt; getColumnSegments() {
return null == cursorStatementContext ? Collections.emptyList() : cursorStatementContext.getColumnSegments();
}
@Override
public Collection&lt;BinaryOperationExpression&gt; getJoinConditions() {
return null == cursorStatementContext ? Collections.emptyList() : cursorStatementContext.getJoinConditions();
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L417">417</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L419">419</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>for (ColumnNameContext each : ctx.columnName()) {
result.getValue().add((ColumnSegment) visit(each));
}
return result;
}
@Override
public final ASTNode visitExpr(final ExprContext ctx) {
if (null != ctx.booleanPrimary()) {
return visit(ctx.booleanPrimary());
}
if (null != ctx.LP_()) {
return visit(ctx.expr(0));
}
if (null != ctx.andOperator()) {
return createBinaryOperationExpression(ctx, ctx.andOperator().getText());
}
if (null != ctx.orOperator()) {
return createBinaryOperationExpression(ctx, ctx.orOperator().getText());
}
if (null != ctx.datetimeExpr()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.html#L535">535</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/type/SQLServerDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/type/SQLServerDDLStatementVisitor.html#L228">228</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>for (AlterDefinitionSegment each : ((CollectionValue&lt;AlterDefinitionSegment&gt;) visit(ctx.alterDefinitionClause())).getValue()) {
if (each instanceof AddColumnDefinitionSegment) {
result.getAddColumnDefinitions().add((AddColumnDefinitionSegment) each);
} else if (each instanceof ModifyColumnDefinitionSegment) {
result.getModifyColumnDefinitions().add((ModifyColumnDefinitionSegment) each);
} else if (each instanceof DropColumnDefinitionSegment) {
result.getDropColumnDefinitions().add((DropColumnDefinitionSegment) each);
} else if (each instanceof AddConstraintDefinitionSegment) {
result.getAddConstraintDefinitions().add((AddConstraintDefinitionSegment) each);
} else if (each instanceof ModifyConstraintDefinitionSegment) {
result.getModifyConstraintDefinitions().add((ModifyConstraintDefinitionSegment) each);
} else if (each instanceof DropConstraintDefinitionSegment) {
result.getDropConstraintDefinitions().add((DropConstraintDefinitionSegment) each);
} else if (each instanceof ModifyCollectionRetrievalSegment) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.html#L165">165</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/type/SQLServerDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/type/SQLServerDDLStatementVisitor.html#L238">238</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>result.getAddConstraintDefinitions().add((AddConstraintDefinitionSegment) each);
} else if (each instanceof DropConstraintDefinitionSegment) {
result.getDropConstraintDefinitions().add((DropConstraintDefinitionSegment) each);
}
}
}
return result;
}
@SuppressWarnings(&quot;unchecked&quot;)
@Override
public ASTNode visitAlterDefinitionClause(final AlterDefinitionClauseContext ctx) {
CollectionValue&lt;AlterDefinitionSegment&gt; result = new CollectionValue&lt;&gt;();
if (null != ctx.addColumnSpecification()) {
result.getValue().addAll(((CollectionValue&lt;AddColumnDefinitionSegment&gt;) visit(ctx.addColumnSpecification())).getValue());
}
if (null != ctx.modifyColumnSpecification()) {
result.getValue().add((ModifyColumnDefinitionSegment) visit(ctx.modifyColumnSpecification()));
}
if (null != ctx.dropColumnSpecification()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/distsql/parser/core/EncryptDistSQLStatementVisitor.java</td>
<td>shardingsphere-encrypt-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/distsql/parser/core/EncryptDistSQLStatementVisitor.html#L114">114</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sharding/distsql/parser/core/ShardingDistSQLStatementVisitor.java</td>
<td>shardingsphere-sharding-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/distsql/parser/core/ShardingDistSQLStatementVisitor.html#L305">305</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return null == context ? null : new IdentifierValue(context.getText()).getValue();
}
private Properties getProperties(final PropertiesDefinitionContext ctx) {
Properties result = new Properties();
if (null == ctx || null == ctx.properties()) {
return result;
}
for (PropertyContext each : ctx.properties().property()) {
result.setProperty(IdentifierValue.getQuotedContent(each.key.getText()), IdentifierValue.getQuotedContent(each.value.getText()));
}
return result;
}
@Override
public ASTNode visitTableName(final TableNameContext ctx) {
return new TableNameSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), new IdentifierValue(ctx.getText()));
}
@Override
public ASTNode visitDatabaseName(final DatabaseNameContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sharding/rule/checker/ShardingRuleChecker.java</td>
<td>shardingsphere-sharding-core</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/rule/checker/ShardingRuleChecker.html#L117">117</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sharding/distsql/handler/checker/ShardingTableRuleStatementChecker.java</td>
<td>shardingsphere-sharding-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/distsql/handler/checker/ShardingTableRuleStatementChecker.html#L264">264</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private boolean isValidActualTableName(final ShardingTable sampleShardingTable, final ShardingTable shardingTable) {
for (String each : sampleShardingTable.getActualDataSourceNames()) {
Collection&lt;String&gt; sampleActualTableNames =
sampleShardingTable.getActualTableNames(each).stream().map(actualTableName -&gt; actualTableName.replace(sampleShardingTable.getTableDataNode().getPrefix(), &quot;&quot;))
.collect(Collectors.toSet());
Collection&lt;String&gt; actualTableNames =
shardingTable.getActualTableNames(each).stream().map(optional -&gt; optional.replace(shardingTable.getTableDataNode().getPrefix(), &quot;&quot;)).collect(Collectors.toSet());
if (!sampleActualTableNames.equals(actualTableNames)) {
return false;
}
}
return true;
}
private boolean isBindingShardingAlgorithm(final ShardingTable sampleShardingTable, final ShardingTable shardingTable, final boolean databaseAlgorithm,</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L298">298</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.html#L533">533</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L371">371</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.html#L155">155</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>result.setTable((SimpleTableSegment) visit(ctx.tableNameClause().tableName()));
if (null != ctx.alterDefinitionClause()) {
for (AlterDefinitionSegment each : ((CollectionValue&lt;AlterDefinitionSegment&gt;) visit(ctx.alterDefinitionClause())).getValue()) {
if (each instanceof AddColumnDefinitionSegment) {
result.getAddColumnDefinitions().add((AddColumnDefinitionSegment) each);
} else if (each instanceof ModifyColumnDefinitionSegment) {
result.getModifyColumnDefinitions().add((ModifyColumnDefinitionSegment) each);
} else if (each instanceof DropColumnDefinitionSegment) {
result.getDropColumnDefinitions().add((DropColumnDefinitionSegment) each);
} else if (each instanceof AddConstraintDefinitionSegment) {
result.getAddConstraintDefinitions().add((AddConstraintDefinitionSegment) each);
} else if (each instanceof ValidateConstraintDefinitionSegment) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L889">889</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L859">859</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussUpdateStatement result = new OpenGaussUpdateStatement();
SimpleTableSegment tableSegment = (SimpleTableSegment) visit(ctx.relationExprOptAlias());
result.setTable(tableSegment);
result.setSetAssignment((SetAssignmentSegment) visit(ctx.setClauseList()));
if (null != ctx.whereOrCurrentClause()) {
result.setWhere((WhereSegment) visit(ctx.whereOrCurrentClause()));
}
result.addParameterMarkerSegments(getParameterMarkerSegments());
return result;
}
@Override
public ASTNode visitSetClauseList(final SetClauseListContext ctx) {
Collection&lt;ColumnAssignmentSegment&gt; assignments = generateAssignmentSegments(ctx);
return new SetAssignmentSegment(ctx.start.getStartIndex() - 4, ctx.stop.getStopIndex(), assignments);
}
@Override
public ASTNode visitDelete(final DeleteContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L994">994</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L1142">1142</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussCommentStatement result = new OpenGaussCommentStatement();
Iterator&lt;NameSegment&gt; nameSegmentIterator = ((CollectionValue&lt;NameSegment&gt;) visit(ctx.commentClauses().anyName())).getValue().iterator();
Optional&lt;NameSegment&gt; columnName = nameSegmentIterator.hasNext() ? Optional.of(nameSegmentIterator.next()) : Optional.empty();
columnName.ifPresent(optional -&gt; result.setColumn(new ColumnSegment(optional.getStartIndex(), optional.getStopIndex(), optional.getIdentifier())));
result.setComment(new IdentifierValue(ctx.commentClauses().commentText().getText()));
setTableSegment(result, nameSegmentIterator);
return result;
}
@SuppressWarnings(&quot;unchecked&quot;)
private OpenGaussCommentStatement commentOnTable(final CommentContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L223">223</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L419">419</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>for (ColumnNameContext each : ctx.columnName()) {
result.getValue().add((ColumnSegment) visit(each));
}
return result;
}
@Override
public final ASTNode visitExpr(final ExprContext ctx) {
if (null != ctx.booleanPrimary()) {
return visit(ctx.booleanPrimary());
}
if (null != ctx.LP_()) {
return visit(ctx.expr(0));
}
if (null != ctx.andOperator()) {
return createBinaryOperationExpression(ctx, ctx.andOperator().getText());
}
if (null != ctx.orOperator()) {
return createBinaryOperationExpression(ctx, ctx.orOperator().getText());
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.html#L157">157</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L1372">1372</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
@Override
public ASTNode visitAssignmentValues(final AssignmentValuesContext ctx) {
List&lt;ExpressionSegment&gt; segments = new LinkedList&lt;&gt;();
for (AssignmentValueContext each : ctx.assignmentValue()) {
segments.add((ExpressionSegment) visit(each));
}
return new InsertValuesSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), segments);
}
@Override
public ASTNode visitAssignment(final AssignmentContext ctx) {
ColumnSegment column = (ColumnSegment) visitColumnName(ctx.columnName());
List&lt;ColumnSegment&gt; columnSegments = new LinkedList&lt;&gt;();
columnSegments.add(column);
ExpressionSegment value = (ExpressionSegment) visit(ctx.assignmentValue());</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java</td>
<td>shardingsphere-jdbc</td>
<td><a href="./xref/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.html#L551">551</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java</td>
<td>shardingsphere-jdbc</td>
<td><a href="./xref/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.html#L619">619</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>currentResultSet = new ShardingSphereResultSet(resultSets, mergedResult, this, selectContainsEnhancedTable, executionContext, columnLabelAndIndexMap);
}
return currentResultSet;
}
private List&lt;ResultSet&gt; getResultSets() throws SQLException {
List&lt;ResultSet&gt; result = new ArrayList&lt;&gt;(statements.size());
for (Statement each : statements) {
if (null != each.getResultSet()) {
result.add(each.getResultSet());
}
}
return result;
}
private List&lt;QueryResult&gt; getQueryResults(final List&lt;ResultSet&gt; resultSets) throws SQLException {
List&lt;QueryResult&gt; result = new ArrayList&lt;&gt;(resultSets.size());
for (ResultSet each : resultSets) {
if (null != each) {
result.add(new JDBCStreamQueryResult(each));
}
}
return result;
}
private ExecutionContext createExecutionContext(final QueryContext queryContext) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L1238">1238</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L555">555</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>List&lt;TerminalNode&gt; numbers = ctx.INTEGER_();
if (numbers.size() == 1) {
result.setPrecision(Integer.parseInt(numbers.get(0).getText()));
}
if (numbers.size() == 2) {
result.setPrecision(Integer.parseInt(numbers.get(0).getText()));
result.setScale(Integer.parseInt(numbers.get(1).getText()));
}
return result;
}
/**
* Get original text.
*
* @param ctx context
* @return original text
*/
protected String getOriginalText(final ParserRuleContext ctx) {
return ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sharding/distsql/handler/update/AlterDefaultShardingStrategyExecutor.java</td>
<td>shardingsphere-sharding-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/distsql/handler/update/AlterDefaultShardingStrategyExecutor.html#L105">105</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sharding/distsql/handler/update/CreateDefaultShardingStrategyExecutor.java</td>
<td>shardingsphere-sharding-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/distsql/handler/update/CreateDefaultShardingStrategyExecutor.html#L103">103</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>shardingRuleConfig.getShardingAlgorithms().put(result, createAlgorithmConfiguration(sqlStatement.getAlgorithmSegment()));
return result;
}
private AlgorithmConfiguration createAlgorithmConfiguration(final AlgorithmSegment segment) {
return new AlgorithmConfiguration(segment.getName(), segment.getProps());
}
private String getDefaultShardingAlgorithmName(final String defaultType, final String algorithmType) {
return String.format(&quot;default_%s_%s&quot;, defaultType, algorithmType).toLowerCase();
}
private void setStrategyConfiguration(final ShardingRuleConfiguration ruleConfig, final String type, final ShardingStrategyConfiguration shardingStrategyConfig) {
if (type.equalsIgnoreCase(ShardingStrategyLevelType.TABLE.name())) {
ruleConfig.setDefaultTableShardingStrategy(shardingStrategyConfig);
} else {
ruleConfig.setDefaultDatabaseShardingStrategy(shardingStrategyConfig);
}
}
@Override
public ShardingRuleConfiguration buildToBeDroppedRuleConfiguration(final ShardingRuleConfiguration toBeAlteredRuleConfig) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L146">146</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L289">289</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
@Override
public final ASTNode visitNumberLiterals(final NumberLiteralsContext ctx) {
return new NumberLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitHexadecimalLiterals(final HexadecimalLiteralsContext ctx) {
// TODO deal with hexadecimalLiterals
return new OtherLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitBitValueLiterals(final BitValueLiteralsContext ctx) {
// TODO deal with bitValueLiterals
return new OtherLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitBooleanLiterals(final BooleanLiteralsContext ctx) {
return new BooleanLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitNullValueLiterals(final NullValueLiteralsContext ctx) {
return new NullLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitIdentifier(final IdentifierContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sharding/distsql/handler/update/AlterShardingTableRuleExecutor.java</td>
<td>shardingsphere-sharding-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/distsql/handler/update/AlterShardingTableRuleExecutor.html#L70">70</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sharding/distsql/handler/update/DropShardingTableRuleExecutor.java</td>
<td>shardingsphere-sharding-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/distsql/handler/update/DropShardingTableRuleExecutor.html#L108">108</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
UnusedAlgorithmFinder.findUnusedShardingAlgorithm(rule.getConfiguration()).forEach(each -&gt; result.getShardingAlgorithms().put(each, rule.getConfiguration().getShardingAlgorithms().get(each)));
UnusedAlgorithmFinder.findUnusedKeyGenerator(rule.getConfiguration()).forEach(each -&gt; result.getKeyGenerators().put(each, rule.getConfiguration().getKeyGenerators().get(each)));
UnusedAlgorithmFinder.findUnusedAuditor(rule.getConfiguration()).forEach(each -&gt; result.getAuditors().put(each, rule.getConfiguration().getAuditors().get(each)));
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java</td>
<td>shardingsphere-jdbc</td>
<td><a href="./xref/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.html#L736">736</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java</td>
<td>shardingsphere-jdbc</td>
<td><a href="./xref/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.html#L647">647</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>clearParameters();
}
@SuppressWarnings(&quot;MagicConstant&quot;)
@Override
public int getResultSetType() {
return statementOption.getResultSetType();
}
@SuppressWarnings(&quot;MagicConstant&quot;)
@Override
public int getResultSetConcurrency() {
return statementOption.getResultSetConcurrency();
}
@Override
public int getResultSetHoldability() {
return statementOption.getResultSetHoldability();
}
@Override
public boolean isAccumulate() {
for (DataNodeRuleAttribute each : metaDataContexts.getMetaData().getDatabase(databaseName).getRuleMetaData().getAttributes(DataNodeRuleAttribute.class)) {
if (each.isNeedAccumulate(executionContext.getSqlStatementContext().getTablesContext().getTableNames())) {
return true;
}
}
return false;
}
@Override
public Collection&lt;PreparedStatement&gt; getRoutedStatements() {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/distsql/handler/engine/update/rdl/rule/engine/database/type/AlterDatabaseRuleOperator.java</td>
<td>shardingsphere-infra-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/distsql/handler/engine/update/rdl/rule/engine/database/type/AlterDatabaseRuleOperator.html#L55">55</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/distsql/handler/engine/update/rdl/rule/engine/database/type/CreateDatabaseRuleOperator.java</td>
<td>shardingsphere-infra-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/distsql/handler/engine/update/rdl/rule/engine/database/type/CreateDatabaseRuleOperator.html#L53">53</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return modeContextManager.alterRuleConfiguration(database.getName(), decorateRuleConfiguration(database, toBeAlteredRuleConfig));
}
@SuppressWarnings(&quot;unchecked&quot;)
private RuleConfiguration decorateRuleConfiguration(final ShardingSphereDatabase database, final RuleConfiguration ruleConfig) {
return TypedSPILoader.findService(RuleConfigurationDecorator.class, ruleConfig.getClass()).map(optional -&gt; optional.decorate(database.getName(),
database.getResourceMetaData().getStorageUnits().entrySet().stream()
.collect(Collectors.toMap(Entry::getKey, entry -&gt; entry.getValue().getDataSource(), (oldValue, currentValue) -&gt; oldValue, LinkedHashMap::new)),
database.getRuleMetaData().getRules(), ruleConfig)).orElse(ruleConfig);
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sharding/merge/dql/pagination/RowNumberDecoratorMergedResult.java</td>
<td>shardingsphere-sharding-core</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/merge/dql/pagination/RowNumberDecoratorMergedResult.html#L37">37</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResult.java</td>
<td>shardingsphere-sharding-core</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResult.html#L37">37</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public RowNumberDecoratorMergedResult(final MergedResult mergedResult, final PaginationContext paginationContext) throws SQLException {
super(mergedResult);
this.paginationContext = paginationContext;
skipAll = skipOffset();
}
private boolean skipOffset() throws SQLException {
long end = paginationContext.getActualOffset();
for (int i = 0; i &lt; end; i++) {
if (!getMergedResult().next()) {
return true;
}
}
rowNumber = end + 1;
return false;
}
@Override
public boolean next() throws SQLException {
if (skipAll) {
return false;
}
if (!paginationContext.getActualRowCount().isPresent()) {
return getMergedResult().next();
}
return rowNumber++ &lt; paginationContext.getActualRowCount().get() &amp;&amp; getMergedResult().next();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/infra/connection/refresher/type/view/AlterViewStatementSchemaRefresher.java</td>
<td>shardingsphere-infra-context</td>
<td><a href="./xref/org/apache/shardingsphere/infra/connection/refresher/type/view/AlterViewStatementSchemaRefresher.html#L76">76</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/infra/connection/refresher/type/view/CreateViewStatementSchemaRefresher.java</td>
<td>shardingsphere-infra-context</td>
<td><a href="./xref/org/apache/shardingsphere/infra/connection/refresher/type/view/CreateViewStatementSchemaRefresher.html#L52">52</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>RuleMetaData ruleMetaData = new RuleMetaData(new LinkedList&lt;&gt;(database.getRuleMetaData().getRules()));
if (TableRefreshUtils.isSingleTable(viewName, database)) {
ruleMetaData.getAttributes(MutableDataNodeRuleAttribute.class).forEach(each -&gt; each.put(logicDataSourceNames.iterator().next(), schemaName, viewName));
}
GenericSchemaBuilderMaterial material = new GenericSchemaBuilderMaterial(
database.getProtocolType(), database.getResourceMetaData().getStorageUnits(), ruleMetaData.getRules(), props, schemaName);
Map&lt;String, ShardingSphereSchema&gt; schemaMap = GenericSchemaBuilder.build(Collections.singletonList(viewName), material);
Optional&lt;ShardingSphereTable&gt; actualViewMetaData = Optional.ofNullable(schemaMap.get(schemaName)).map(optional -&gt; optional.getTable(viewName));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L230">230</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L230">230</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L178">178</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L331">331</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return null == unreservedWord ? new IdentifierValue(ctx.getText()) : visit(unreservedWord);
}
@Override
public final ASTNode visitUnreservedWord(final UnreservedWordContext ctx) {
return new IdentifierValue(ctx.getText());
}
@Override
public final ASTNode visitSchemaName(final SchemaNameContext ctx) {
return visit(ctx.identifier());
}
@Override
public final ASTNode visitTableName(final TableNameContext ctx) {
SimpleTableSegment result = new SimpleTableSegment(new TableNameSegment(ctx.name().getStart().getStartIndex(), ctx.name().getStop().getStopIndex(), (IdentifierValue) visit(ctx.name())));
OwnerContext owner = ctx.owner();
if (null != owner) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L328">328</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L364">364</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final ASTNode visitTableName(final TableNameContext ctx) {
SimpleTableSegment result = new SimpleTableSegment(new TableNameSegment(ctx.name().getStart().getStartIndex(),
ctx.name().getStop().getStopIndex(), new IdentifierValue(ctx.name().identifier().getText())));
OwnerContext owner = ctx.owner();
if (null != owner) {
result.setOwner(new OwnerSegment(owner.getStart().getStartIndex(), owner.getStop().getStopIndex(), (IdentifierValue) visit(owner.identifier())));
}
return result;
}
@Override
public final ASTNode visitColumnName(final ColumnNameContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L594">594</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L573">573</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>statementParameterMarkerSegments.add(segment);
return segment;
}
if (astNode instanceof SubquerySegment) {
return new SubqueryExpressionSegment((SubquerySegment) astNode);
}
if (astNode instanceof OtherLiteralValue) {
return new CommonExpressionSegment(context.getStart().getStartIndex(), context.getStop().getStopIndex(), context.getText());
}
return astNode;
}
@Override
public final ASTNode visitSimpleExpr(final SimpleExprContext ctx) {
int startIndex = ctx.getStart().getStartIndex();
int stopIndex = ctx.getStop().getStopIndex();
if (null != ctx.subquery()) {
return new SubquerySegment(startIndex, stopIndex, (OracleSelectStatement) visit(ctx.subquery()), getOriginalText(ctx.subquery()));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/proxy/frontend/opengauss/command/OpenGaussCommandExecutorFactory.java</td>
<td>shardingsphere-proxy-frontend-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/proxy/frontend/opengauss/command/OpenGaussCommandExecutorFactory.html#L90">90</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/proxy/frontend/postgresql/command/PostgreSQLCommandExecutorFactory.java</td>
<td>shardingsphere-proxy-frontend-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/proxy/frontend/postgresql/command/PostgreSQLCommandExecutorFactory.html#L85">85</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>result.add(getCommandExecutor((CommandPacketType) each.getIdentifier(), each, connectionSession, portalContext));
}
return new PostgreSQLAggregatedCommandExecutor(result);
}
private static List&lt;CommandExecutor&gt; getExecutorsOfAggregatedBatchedStatements(final PostgreSQLAggregatedCommandPacket aggregatedCommandPacket,
final ConnectionSession connectionSession, final PortalContext portalContext) throws SQLException {
List&lt;PostgreSQLCommandPacket&gt; packets = aggregatedCommandPacket.getPackets();
int batchPacketBeginIndex = aggregatedCommandPacket.getBatchPacketBeginIndex();
int batchPacketEndIndex = aggregatedCommandPacket.getBatchPacketEndIndex();
List&lt;CommandExecutor&gt; result = new ArrayList&lt;&gt;(batchPacketBeginIndex + packets.size() - batchPacketEndIndex);
for (int i = 0; i &lt; batchPacketBeginIndex; i++) {
PostgreSQLCommandPacket each = packets.get(i);
result.add(getCommandExecutor((CommandPacketType) each.getIdentifier(), each, connectionSession, portalContext));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/distsql/parser/core/EncryptDistSQLStatementVisitor.java</td>
<td>shardingsphere-encrypt-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/distsql/parser/core/EncryptDistSQLStatementVisitor.html#L110">110</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/mask/distsql/parser/core/MaskDistSQLStatementVisitor.java</td>
<td>shardingsphere-mask-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/mask/distsql/parser/core/MaskDistSQLStatementVisitor.html#L94">94</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/globalclock/distsql/parser/core/GlobalClockDistSQLStatementVisitor.java</td>
<td>shardingsphere-global-clock-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/globalclock/distsql/parser/core/GlobalClockDistSQLStatementVisitor.html#L49">49</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>return new AlgorithmSegment(getIdentifierValue(ctx.algorithmTypeName()), getProperties(ctx.propertiesDefinition()));
}
private String getIdentifierValue(final ParseTree context) {
return null == context ? null : new IdentifierValue(context.getText()).getValue();
}
private Properties getProperties(final PropertiesDefinitionContext ctx) {
Properties result = new Properties();
if (null == ctx || null == ctx.properties()) {
return result;
}
for (PropertyContext each : ctx.properties().property()) {
result.setProperty(IdentifierValue.getQuotedContent(each.key.getText()), IdentifierValue.getQuotedContent(each.value.getText()));
}
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L269">269</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L126">126</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return visit(ctx.temporalLiterals());
}
if (null != ctx.hexadecimalLiterals()) {
return visit(ctx.hexadecimalLiterals());
}
if (null != ctx.bitValueLiterals()) {
return visit(ctx.bitValueLiterals());
}
if (null != ctx.booleanLiterals()) {
return visit(ctx.booleanLiterals());
}
if (null != ctx.nullValueLiterals()) {
return visit(ctx.nullValueLiterals());
}
throw new IllegalStateException(&quot;Literals must have string, number, dateTime, hex, bit, boolean or null.&quot;);
}
@Override
public final ASTNode visitStringLiterals(final StringLiteralsContext ctx) {
return new StringLiteralValue(ctx.getText());
}
@Override
public ASTNode visitString_(final String_Context ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/proxy/frontend/opengauss/command/OpenGaussCommandExecutorFactory.java</td>
<td>shardingsphere-proxy-frontend-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/proxy/frontend/opengauss/command/OpenGaussCommandExecutorFactory.html#L120">120</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/proxy/frontend/postgresql/command/PostgreSQLCommandExecutorFactory.java</td>
<td>shardingsphere-proxy-frontend-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/proxy/frontend/postgresql/command/PostgreSQLCommandExecutorFactory.html#L112">112</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return new OpenGaussComQueryExecutor(portalContext, (PostgreSQLComQueryPacket) commandPacket, connectionSession);
case PARSE_COMMAND:
return new PostgreSQLComParseExecutor((PostgreSQLComParsePacket) commandPacket, connectionSession);
case BIND_COMMAND:
return new PostgreSQLComBindExecutor(portalContext, (PostgreSQLComBindPacket) commandPacket, connectionSession);
case DESCRIBE_COMMAND:
return new PostgreSQLComDescribeExecutor(portalContext, (PostgreSQLComDescribePacket) commandPacket, connectionSession);
case EXECUTE_COMMAND:
return new PostgreSQLComExecuteExecutor(portalContext, (PostgreSQLComExecutePacket) commandPacket);
case SYNC_COMMAND:
return new PostgreSQLComSyncExecutor(connectionSession);
case CLOSE_COMMAND:
return new PostgreSQLComCloseExecutor(portalContext, (PostgreSQLComClosePacket) commandPacket, connectionSession);
case FLUSH_COMMAND:
return new PostgreSQLComFlushExecutor();
case TERMINATE:
return new PostgreSQLComTerminationExecutor();
default:
return new PostgreSQLUnsupportedCommandExecutor();
}
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/rule/changed/EncryptTableChangedProcessor.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rule/changed/EncryptTableChangedProcessor.html#L43">43</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/encrypt/rule/changed/EncryptorChangedProcessor.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rule/changed/EncryptorChangedProcessor.html#L44">44</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return new YamlEncryptTableRuleConfigurationSwapper().swapToObject(YamlEngine.unmarshal(yamlContent, YamlEncryptTableRuleConfiguration.class));
}
@Override
public EncryptRuleConfiguration findRuleConfiguration(final ShardingSphereDatabase database) {
return database.getRuleMetaData().findSingleRule(EncryptRule.class)
.map(optional -&gt; getEncryptRuleConfiguration(optional.getConfiguration()))
.orElseGet(() -&gt; new EncryptRuleConfiguration(new LinkedList&lt;&gt;(), new LinkedHashMap&lt;&gt;()));
}
private EncryptRuleConfiguration getEncryptRuleConfiguration(final EncryptRuleConfiguration config) {
return null == config.getTables() ? new EncryptRuleConfiguration(new LinkedList&lt;&gt;(), config.getEncryptors()) : config;
}
@Override
public void changeRuleItemConfiguration(final AlterRuleItemEvent event, final EncryptRuleConfiguration currentRuleConfig, final EncryptTableRuleConfiguration toBeChangedItemConfig) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java</td>
<td>shardingsphere-jdbc</td>
<td><a href="./xref/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.html#L527">527</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java</td>
<td>shardingsphere-jdbc</td>
<td><a href="./xref/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.html#L597">597</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
@Override
public ResultSet getResultSet() throws SQLException {
if (null != currentResultSet) {
return currentResultSet;
}
if (null != trafficInstanceId) {
return executor.getTrafficExecutor().getResultSet();
}
if (useFederation) {
return executor.getSqlFederationEngine().getResultSet();
}
if (executionContext.getSqlStatementContext() instanceof SelectStatementContext
|| executionContext.getSqlStatementContext().getSqlStatement() instanceof DALStatement) {
List&lt;ResultSet&gt; resultSets = getResultSets();
if (resultSets.isEmpty()) {
return currentResultSet;
}
SQLStatementContext sqlStatementContext = executionContext.getSqlStatementContext();
MergedResult mergedResult = mergeQuery(getQueryResults(resultSets), sqlStatementContext);</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/data/pipeline/opengauss/check/datasource/OpenGaussDataSourceChecker.java</td>
<td>shardingsphere-data-pipeline-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/data/pipeline/opengauss/check/datasource/OpenGaussDataSourceChecker.html#L37">37</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/data/pipeline/postgresql/check/datasource/PostgreSQLDataSourceChecker.java</td>
<td>shardingsphere-data-pipeline-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/data/pipeline/postgresql/check/datasource/PostgreSQLDataSourceChecker.html#L39">39</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final class OpenGaussDataSourceChecker implements DialectDataSourceChecker {
private static final String SHOW_GRANTS_SQL = &quot;SELECT * FROM pg_roles WHERE rolname = ?&quot;;
@Override
public void checkPrivilege(final DataSource dataSource) {
try (Connection connection = dataSource.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement(SHOW_GRANTS_SQL)) {
DatabaseMetaData metaData = connection.getMetaData();
preparedStatement.setString(1, metaData.getUserName());
try (ResultSet resultSet = preparedStatement.executeQuery()) {
String username = metaData.getUserName();
ShardingSpherePreconditions.checkState(resultSet.next(), () -&gt; new PrepareJobWithoutUserException(username));
String isSuperRole = resultSet.getString(&quot;rolsuper&quot;);
String isReplicationRole = resultSet.getString(&quot;rolreplication&quot;);</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/data/pipeline/cdc/distsql/parser/core/CDCDistSQLStatementVisitor.java</td>
<td>shardingsphere-data-pipeline-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/data/pipeline/cdc/distsql/parser/core/CDCDistSQLStatementVisitor.html#L134">134</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/traffic/distsql/parser/core/TrafficDistSQLStatementVisitor.java</td>
<td>shardingsphere-traffic-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/traffic/distsql/parser/core/TrafficDistSQLStatementVisitor.html#L66">66</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return visit(ctx.algorithmDefinition());
}
@Override
public ASTNode visitAlgorithmDefinition(final AlgorithmDefinitionContext ctx) {
return new AlgorithmSegment(getIdentifierValue(ctx.algorithmTypeName()), buildProperties(ctx.propertiesDefinition()));
}
private Properties buildProperties(final PropertiesDefinitionContext ctx) {
Properties result = new Properties();
if (null == ctx) {
return result;
}
for (PropertyContext each : ctx.properties().property()) {
result.setProperty(IdentifierValue.getQuotedContent(each.key.getText()), IdentifierValue.getQuotedContent(each.value.getText()));
}
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L398">398</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L408">408</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L214">214</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>for (ViewNameContext each : ctx.viewName()) {
result.getValue().add((SimpleTableSegment) visit(each));
}
return result;
}
@Override
public final ASTNode visitColumnNames(final ColumnNamesContext ctx) {
CollectionValue&lt;ColumnSegment&gt; result = new CollectionValue&lt;&gt;();
for (ColumnNameContext each : ctx.columnName()) {
result.getValue().add((ColumnSegment) visit(each));
}
return result;
}
@Override
public final ASTNode visitExpr(final ExprContext ctx) {
if (null != ctx.booleanPrimary()) {
return visit(ctx.booleanPrimary());
}
if (null != ctx.XOR()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/distsql/handler/update/AlterEncryptRuleExecutor.java</td>
<td>shardingsphere-encrypt-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/distsql/handler/update/AlterEncryptRuleExecutor.html#L76">76</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleExecutor.java</td>
<td>shardingsphere-encrypt-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleExecutor.html#L79">79</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private void checkColumnNames(final AlterEncryptRuleStatement sqlStatement) {
for (EncryptRuleSegment each : sqlStatement.getRules()) {
ShardingSpherePreconditions.checkState(isColumnNameNotConflicts(each),
() -&gt; new InvalidRuleConfigurationException(&quot;encrypt&quot;, &quot;assisted query column or like query column conflicts with logic column&quot;));
}
}
private boolean isColumnNameNotConflicts(final EncryptRuleSegment rule) {
return rule.getColumns().stream().noneMatch(each -&gt; null != each.getLikeQuery() &amp;&amp; each.getName().equals(each.getLikeQuery().getName())
|| null != each.getAssistedQuery() &amp;&amp; each.getName().equals(each.getAssistedQuery().getName()));
}
private void checkToBeAlteredEncryptors(final AlterEncryptRuleStatement sqlStatement) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sharding/rule/ShardingRule.java</td>
<td>shardingsphere-sharding-core</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/rule/ShardingRule.html#L154">154</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sharding/distsql/handler/checker/ShardingTableRuleStatementChecker.java</td>
<td>shardingsphere-sharding-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/distsql/handler/checker/ShardingTableRuleStatementChecker.html#L174">174</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private Collection&lt;String&gt; getDataSourceNames(final Collection&lt;ShardingTableRuleConfiguration&gt; tableRuleConfigs,
final Collection&lt;ShardingAutoTableRuleConfiguration&gt; autoTableRuleConfigs, final Collection&lt;String&gt; dataSourceNames) {
if (tableRuleConfigs.isEmpty() &amp;&amp; autoTableRuleConfigs.isEmpty()) {
return dataSourceNames;
}
if (tableRuleConfigs.stream().map(ShardingTableRuleConfiguration::getActualDataNodes).anyMatch(each -&gt; null == each || each.isEmpty())) {
return dataSourceNames;
}
Collection&lt;String&gt; result = new LinkedHashSet&lt;&gt;();
tableRuleConfigs.forEach(each -&gt; result.addAll(getDataSourceNames(each)));
autoTableRuleConfigs.forEach(each -&gt; result.addAll(getDataSourceNames(each)));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L573">573</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L337">337</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L536">536</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}
private BetweenExpression createBetweenSegment(final PredicateContext ctx) {
ExpressionSegment left = (ExpressionSegment) visit(ctx.bitExpr(0));
ExpressionSegment between = (ExpressionSegment) visit(ctx.bitExpr(1));
ExpressionSegment and = (ExpressionSegment) visit(ctx.predicate());
boolean not = null != ctx.NOT();
return new BetweenExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, between, and, not);
}
@Override
public final ASTNode visitBitExpr(final BitExprContext ctx) {
if (null != ctx.simpleExpr()) {
return visit(ctx.simpleExpr());</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/InstallComponentStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/InstallComponentStatementAssert.html#L45">45</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/UninstallComponentStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/UninstallComponentStatementAssert.html#L45">45</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLInstallComponentStatement actual, final InstallComponentStatementTestCase expected) {
assertThat(assertContext.getText(&quot;Actual components size assertion error: &quot;), actual.getComponents().size(), is(expected.getComponents().size()));
assertComponents(assertContext, actual.getComponents(), expected.getComponents());
}
private static void assertComponents(final SQLCaseAssertContext assertContext, final List&lt;String&gt; actual, final List&lt;ExpectedComponent&gt; expected) {
int count = 0;
for (String each : actual) {
assertThat(assertContext.getText(&quot;Actual component value does not match: &quot;), each, is(expected.get(count).getName()));
count++;
}
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/readwritesplitting/yaml/swapper/YamlReadwriteSplittingDataNodeRuleConfigurationSwapper.java</td>
<td>shardingsphere-readwrite-splitting-core</td>
<td><a href="./xref/org/apache/shardingsphere/readwritesplitting/yaml/swapper/YamlReadwriteSplittingDataNodeRuleConfigurationSwapper.html#L93">93</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/readwritesplitting/yaml/swapper/YamlReadwriteSplittingRuleConfigurationSwapper.java</td>
<td>shardingsphere-readwrite-splitting-core</td>
<td><a href="./xref/org/apache/shardingsphere/readwritesplitting/yaml/swapper/YamlReadwriteSplittingRuleConfigurationSwapper.html#L75">75</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private ReadwriteSplittingDataSourceRuleConfiguration swapDataSource(final String name, final YamlReadwriteSplittingDataSourceRuleConfiguration yamlDataSourceRuleConfig) {
return new ReadwriteSplittingDataSourceRuleConfiguration(name, yamlDataSourceRuleConfig.getWriteDataSourceName(), yamlDataSourceRuleConfig.getReadDataSourceNames(),
getTransactionalReadQueryStrategy(yamlDataSourceRuleConfig), yamlDataSourceRuleConfig.getLoadBalancerName());
}
private TransactionalReadQueryStrategy getTransactionalReadQueryStrategy(final YamlReadwriteSplittingDataSourceRuleConfiguration yamlDataSourceRuleConfig) {
return Strings.isNullOrEmpty(yamlDataSourceRuleConfig.getTransactionalReadQueryStrategy())
? TransactionalReadQueryStrategy.DYNAMIC
: TransactionalReadQueryStrategy.valueOf(yamlDataSourceRuleConfig.getTransactionalReadQueryStrategy());
}
@Override
public Class&lt;ReadwriteSplittingRuleConfiguration&gt; getTypeClass() {
return ReadwriteSplittingRuleConfiguration.class;
}
@Override
public String getRuleTagName() {
return &quot;READWRITE_SPLITTING&quot;;
}
@Override
public int getOrder() {
return ReadwriteSplittingOrder.ORDER;
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/data/pipeline/cdc/core/prepare/CDCJobPreparer.java</td>
<td>shardingsphere-data-pipeline-cdc-core</td>
<td><a href="./xref/org/apache/shardingsphere/data/pipeline/cdc/core/prepare/CDCJobPreparer.html#L102">102</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/data/pipeline/scenario/migration/preparer/MigrationJobPreparer.java</td>
<td>shardingsphere-data-pipeline-scenario-migration</td>
<td><a href="./xref/org/apache/shardingsphere/data/pipeline/scenario/migration/preparer/MigrationJobPreparer.html#L176">176</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>CDCTaskConfiguration taskConfig = jobItemContext.getTaskConfig();
JobItemIncrementalTasksProgress initIncremental = null == jobItemContext.getInitProgress() ? null : jobItemContext.getInitProgress().getIncremental();
try {
DatabaseType databaseType = taskConfig.getDumperContext().getCommonContext().getDataSourceConfig().getDatabaseType();
IngestPosition position = new IncrementalTaskPositionManager(databaseType).getPosition(initIncremental, taskConfig.getDumperContext(), jobItemContext.getDataSourceManager());
taskConfig.getDumperContext().getCommonContext().setPosition(position);
} catch (final SQLException ex) {
throw new PrepareJobWithGetBinlogPositionException(jobItemContext.getJobId(), ex);
}
}
private void initInventoryTasks(final CDCJobItemContext jobItemContext, final AtomicBoolean importerUsed, final List&lt;CDCChannelProgressPair&gt; channelProgressPairs) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/traffic/distsql/parser/core/TrafficDistSQLStatementVisitor.java</td>
<td>shardingsphere-traffic-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/traffic/distsql/parser/core/TrafficDistSQLStatementVisitor.html#L66">66</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java</td>
<td>shardingsphere-parser-distsql-engine</td>
<td><a href="./xref/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.html#L295">295</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return null == ctx ? null : visit(ctx.algorithmDefinition());
}
@Override
public ASTNode visitAlgorithmDefinition(final AlgorithmDefinitionContext ctx) {
return new AlgorithmSegment(getIdentifierValue(ctx.algorithmTypeName()), buildProperties(ctx.propertiesDefinition()));
}
private Properties buildProperties(final PropertiesDefinitionContext ctx) {
Properties result = new Properties();
if (null == ctx) {
return result;
}
for (PropertyContext each : ctx.properties().property()) {
result.setProperty(IdentifierValue.getQuotedContent(each.key.getText()), IdentifierValue.getQuotedContent(each.value.getText()));
}
return result;
}
@Override
public ASTNode visitShowTrafficRules(final ShowTrafficRulesContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L607">607</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L590">590</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return new SubqueryExpressionSegment(subquerySegment);
}
if (null != ctx.parameterMarker()) {
ParameterMarkerValue parameterMarker = (ParameterMarkerValue) visit(ctx.parameterMarker());
ParameterMarkerExpressionSegment result = new ParameterMarkerExpressionSegment(startIndex, stopIndex, parameterMarker.getValue(), parameterMarker.getType());
parameterMarkerSegments.add(result);
return result;
}
if (null != ctx.literals()) {
return SQLUtils.createLiteralExpression(visit(ctx.literals()), startIndex, stopIndex, ctx.literals().start.getInputStream().getText(new Interval(startIndex, stopIndex)));
}
if (null != ctx.intervalExpression()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1931">1931</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1947">1947</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public ASTNode visitLimitRowCount(final LimitRowCountContext ctx) {
if (null != ctx.numberLiterals()) {
return new NumberLiteralLimitValueSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ((NumberLiteralValue) visit(ctx.numberLiterals())).getValue().longValue());
}
ParameterMarkerSegment result = new ParameterMarkerLimitValueSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(),
((ParameterMarkerValue) visit(ctx.parameterMarker())).getValue());
parameterMarkerSegments.add(result);
return result;
}
@Override
public final ASTNode visitConstraintName(final ConstraintNameContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sharding/distsql/handler/update/AlterDefaultShardingStrategyExecutor.java</td>
<td>shardingsphere-sharding-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/distsql/handler/update/AlterDefaultShardingStrategyExecutor.html#L72">72</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sharding/distsql/handler/update/DropDefaultShardingStrategyExecutor.java</td>
<td>shardingsphere-sharding-distsql-handler</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/distsql/handler/update/DropDefaultShardingStrategyExecutor.html#L52">52</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private void checkExist(final AlterDefaultShardingStrategyStatement sqlStatement) {
Optional&lt;ShardingStrategyConfiguration&gt; strategyConfig = getStrategyConfiguration(sqlStatement.getDefaultType());
ShardingSpherePreconditions.checkState(strategyConfig.isPresent(),
() -&gt; new MissingRequiredRuleException(String.format(&quot;Default sharding %s strategy&quot;, sqlStatement.getDefaultType().toLowerCase()), database.getName()));
}
private Optional&lt;ShardingStrategyConfiguration&gt; getStrategyConfiguration(final String type) {
ShardingStrategyConfiguration result = type.equalsIgnoreCase(ShardingStrategyLevelType.TABLE.name())
? rule.getConfiguration().getDefaultTableShardingStrategy()
: rule.getConfiguration().getDefaultDatabaseShardingStrategy();
return Optional.ofNullable(result);
}
@Override
public ShardingRuleConfiguration buildToBeAlteredRuleConfiguration(final AlterDefaultShardingStrategyStatement sqlStatement) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManager.java</td>
<td>shardingsphere-cluster-mode-core</td>
<td><a href="./xref/org/apache/shardingsphere/mode/manager/cluster/ClusterModeContextManager.html#L87">87</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/mode/manager/standalone/StandaloneModeContextManager.java</td>
<td>shardingsphere-standalone-mode-core</td>
<td><a href="./xref/org/apache/shardingsphere/mode/manager/standalone/StandaloneModeContextManager.html#L204">204</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>Map&lt;String, ShardingSphereView&gt; views = alterSchemaMetaDataPOJO.getAlteredViews().stream().collect(Collectors.toMap(ShardingSphereView::getName, view -&gt; view));
DatabaseMetaDataBasedPersistService databaseMetaDataService = contextManager.getMetaDataContexts().getPersistService().getDatabaseMetaDataService();
databaseMetaDataService.getTableMetaDataPersistService().persist(databaseName, schemaName, tables);
databaseMetaDataService.getViewMetaDataPersistService().persist(databaseName, schemaName, views);
alterSchemaMetaDataPOJO.getDroppedTables().forEach(each -&gt; databaseMetaDataService.getTableMetaDataPersistService().delete(databaseName, schemaName, each));
alterSchemaMetaDataPOJO.getDroppedViews().forEach(each -&gt; databaseMetaDataService.getViewMetaDataPersistService().delete(databaseName, schemaName, each));
}
@Override
public void registerStorageUnits(final String databaseName, final Map&lt;String, DataSourcePoolProperties&gt; toBeRegisteredProps) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L272">272</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L272">272</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L209">209</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L396">396</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
@Override
public final ASTNode visitTableNames(final TableNamesContext ctx) {
CollectionValue&lt;SimpleTableSegment&gt; result = new CollectionValue&lt;&gt;();
for (TableNameContext each : ctx.tableName()) {
result.getValue().add((SimpleTableSegment) visit(each));
}
return result;
}
@Override
public final ASTNode visitColumnNames(final ColumnNamesContext ctx) {
CollectionValue&lt;ColumnSegment&gt; result = new CollectionValue&lt;&gt;();
for (ColumnNameContext each : ctx.columnName()) {
result.getValue().add((ColumnSegment) visit(each));
}
return result;
}
@Override
public ASTNode visitAExpr(final AExprContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L947">947</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/type/SQLServerDCLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/type/SQLServerDCLStatementVisitor.html#L113">113</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final ASTNode visitViewName(final ViewNameContext ctx) {
SimpleTableSegment result = new SimpleTableSegment(new TableNameSegment(ctx.name().getStart().getStartIndex(),
ctx.name().getStop().getStopIndex(), (IdentifierValue) visit(ctx.name())));
OwnerContext owner = ctx.owner();
if (null != owner) {
result.setOwner(new OwnerSegment(owner.getStart().getStartIndex(), owner.getStop().getStopIndex(), (IdentifierValue) visit(owner.identifier())));
}
return result;
}
@Override
public ASTNode visitSelect(final SelectContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/OpenTelemetryJDBCExecutorCallbackAdvice.java</td>
<td>shardingsphere-agent-tracing-opentelemetry</td>
<td><a href="./xref/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/OpenTelemetryJDBCExecutorCallbackAdvice.html#L56">56</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/OpenTelemetrySQLParserEngineAdvice.java</td>
<td>shardingsphere-agent-tracing-opentelemetry</td>
<td><a href="./xref/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/OpenTelemetrySQLParserEngineAdvice.html#L49">49</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
@Override
public void afterMethod(final TargetAdviceObject target, final Method method, final Object[] args, final Object result, final String pluginType) {
Span span = (Span) target.getAttachment();
span.setStatus(StatusCode.OK);
span.end();
}
@Override
public void onThrowing(final TargetAdviceObject target, final Method method, final Object[] args, final Throwable throwable, final String pluginType) {
Span span = (Span) target.getAttachment();
span.setStatus(StatusCode.ERROR).recordException(throwable);
span.end();
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L943">943</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L780">780</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>if (null != ctx.distinct()) {
AggregationDistinctProjectionSegment result =
new AggregationDistinctProjectionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), type, getOriginalText(ctx), getDistinctExpression(ctx));
result.getParameters().addAll(getExpressions(ctx.expr()));
return result;
}
AggregationProjectionSegment result = new AggregationProjectionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), type, getOriginalText(ctx));
result.getParameters().addAll(getExpressions(ctx.expr()));
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L244">244</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L244">244</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L192">192</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L947">947</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/type/SQLServerDCLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/type/SQLServerDCLStatementVisitor.html#L113">113</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>public final ASTNode visitTableName(final TableNameContext ctx) {
SimpleTableSegment result = new SimpleTableSegment(new TableNameSegment(ctx.name().getStart().getStartIndex(), ctx.name().getStop().getStopIndex(), (IdentifierValue) visit(ctx.name())));
OwnerContext owner = ctx.owner();
if (null != owner) {
result.setOwner(new OwnerSegment(owner.getStart().getStartIndex(), owner.getStop().getStopIndex(), (IdentifierValue) visit(owner.identifier())));
}
return result;
}
@Override
public final ASTNode visitColumnName(final ColumnNameContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.html#L658">658</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.html#L679">679</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>Collection&lt;ColumnSegment&gt; columns = new LinkedList&lt;&gt;();
if (null != ctx.columnOrColumnList().columnName()) {
columns.add((ColumnSegment) visit(ctx.columnOrColumnList().columnName()));
} else {
for (ColumnNameContext each : ctx.columnOrColumnList().columnNames().columnName()) {
columns.add((ColumnSegment) visit(each));
}
}
return new DropColumnDefinitionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), columns);
}
@Override
public ASTNode visitModifyColProperties(final ModifyColPropertiesContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java</td>
<td>shardingsphere-opengauss-protocol</td>
<td><a href="./xref/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.html#L123">123</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java</td>
<td>shardingsphere-postgresql-protocol</td>
<td><a href="./xref/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.html#L121">121</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>PostgreSQLMessageSeverityLevel.ERROR, PostgreSQLVendorError.SYSTEM_ERROR.getSqlState().getValue(), ex.getMessage());
isIdentifierPacket = true;
prepareMessageHeader(out, errorResponsePacket.getIdentifier().getValue());
errorResponsePacket.write(payload);
} finally {
if (isIdentifierPacket) {
updateMessageLength(out);
}
}
}
private void prepareMessageHeader(final ByteBuf out, final char type) {
out.writeByte(type);
out.writeInt(0);
}
private void updateMessageLength(final ByteBuf out) {
out.setInt(1, out.readableBytes() - MESSAGE_TYPE_LENGTH);
}
@Override
public PostgreSQLPacketPayload createPacketPayload(final ByteBuf message, final Charset charset) {
return new PostgreSQLPacketPayload(message, charset);
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/infra/binder/context/segment/insert/values/InsertValueContext.java</td>
<td>shardingsphere-infra-binder</td>
<td><a href="./xref/org/apache/shardingsphere/infra/binder/context/segment/insert/values/InsertValueContext.html#L53">53</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/infra/binder/context/segment/insert/values/OnDuplicateUpdateContext.java</td>
<td>shardingsphere-infra-binder</td>
<td><a href="./xref/org/apache/shardingsphere/infra/binder/context/segment/insert/values/OnDuplicateUpdateContext.html#L57">57</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>parameters = getParameters(params, parametersOffset);
}
private List&lt;ExpressionSegment&gt; getValueExpressions(final Collection&lt;ExpressionSegment&gt; assignments) {
List&lt;ExpressionSegment&gt; result = new ArrayList&lt;&gt;(assignments.size());
result.addAll(assignments);
return result;
}
private List&lt;Object&gt; getParameters(final List&lt;Object&gt; params, final int paramsOffset) {
if (params.isEmpty() || 0 == parameterCount) {
return Collections.emptyList();
}
List&lt;Object&gt; result = new ArrayList&lt;&gt;(parameterCount);
result.addAll(params.subList(paramsOffset, paramsOffset + parameterCount));
return result;
}
/**
* Get literal value.
*
* @param index index
* @return literal value
*/
public Optional&lt;Object&gt; getLiteralValue(final int index) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1578">1578</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L1419">1419</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>result.setLimit((LimitSegment) visit(ctx.limitClause()));
}
result.addParameterMarkerSegments(getParameterMarkerSegments());
return result;
}
@Override
public ASTNode visitSingleTableClause(final SingleTableClauseContext ctx) {
SimpleTableSegment result = (SimpleTableSegment) visit(ctx.tableName());
if (null != ctx.alias()) {
result.setAlias((AliasSegment) visit(ctx.alias()));
}
return result;
}
@Override
public ASTNode visitMultipleTablesClause(final MultipleTablesClauseContext ctx) {
DeleteMultiTableSegment result = new DeleteMultiTableSegment();
TableSegment relateTableSource = (TableSegment) visit(ctx.tableReferences());
result.setRelationTable(relateTableSource);
result.setActualDeleteTables(generateTablesFromTableAliasRefList(ctx.tableAliasRefList()));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.html#L275">275</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L1454">1454</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
@Override
public ASTNode visitProjection(final ProjectionContext ctx) {
// FIXME :The stop index of project is the stop index of projection, instead of alias.
if (null != ctx.qualifiedShorthand()) {
QualifiedShorthandContext shorthand = ctx.qualifiedShorthand();
ShorthandProjectionSegment result = new ShorthandProjectionSegment(shorthand.getStart().getStartIndex(), shorthand.getStop().getStopIndex());
IdentifierValue identifier = new IdentifierValue(shorthand.identifier().getText());
result.setOwner(new OwnerSegment(shorthand.identifier().getStart().getStartIndex(), shorthand.identifier().getStop().getStopIndex(), identifier));
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/rewrite/token/generator/insert/EncryptInsertValuesTokenGenerator.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rewrite/token/generator/insert/EncryptInsertValuesTokenGenerator.html#L112">112</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ShardingInsertValuesTokenGenerator.java</td>
<td>shardingsphere-sharding-core</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ShardingInsertValuesTokenGenerator.html#L62">62</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>result.getInsertValues().add(insertValueToken);
}
return result;
}
private int getStartIndex(final Collection&lt;InsertValuesSegment&gt; segments) {
int result = segments.iterator().next().getStartIndex();
for (InsertValuesSegment each : segments) {
result = Math.min(result, each.getStartIndex());
}
return result;
}
private int getStopIndex(final Collection&lt;InsertValuesSegment&gt; segments) {
int result = segments.iterator().next().getStopIndex();
for (InsertValuesSegment each : segments) {
result = Math.max(result, each.getStopIndex());
}
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/data/pipeline/cdc/distsql/parser/core/CDCDistSQLStatementVisitor.java</td>
<td>shardingsphere-data-pipeline-distsql-parser</td>
<td><a href="./xref/org/apache/shardingsphere/data/pipeline/cdc/distsql/parser/core/CDCDistSQLStatementVisitor.html#L134">134</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java</td>
<td>shardingsphere-parser-distsql-engine</td>
<td><a href="./xref/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.html#L295">295</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return visit(ctx.algorithmDefinition());
}
@Override
public ASTNode visitAlgorithmDefinition(final AlgorithmDefinitionContext ctx) {
return new AlgorithmSegment(getIdentifierValue(ctx.algorithmTypeName()), buildProperties(ctx.propertiesDefinition()));
}
private Properties buildProperties(final PropertiesDefinitionContext ctx) {
Properties result = new Properties();
if (null == ctx) {
return result;
}
for (PropertyContext each : ctx.properties().property()) {
result.setProperty(IdentifierValue.getQuotedContent(each.key.getText()), IdentifierValue.getQuotedContent(each.value.getText()));
}
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/logging/yaml/swapper/YamlLoggingDataNodeRuleConfigurationSwapper.java</td>
<td>shardingsphere-logging-core</td>
<td><a href="./xref/org/apache/shardingsphere/logging/yaml/swapper/YamlLoggingDataNodeRuleConfigurationSwapper.html#L64">64</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/logging/yaml/swapper/YamlLoggingRuleConfigurationSwapper.java</td>
<td>shardingsphere-logging-core</td>
<td><a href="./xref/org/apache/shardingsphere/logging/yaml/swapper/YamlLoggingRuleConfigurationSwapper.html#L42">42</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private LoggingRuleConfiguration swapToObject(final YamlLoggingRuleConfiguration yamlConfig) {
LoggingRuleConfiguration result = new LoggingRuleConfiguration(YamlLoggersConfigurationConverter.convertShardingSphereLogger(yamlConfig.getLoggers()),
YamlAppendersConfigurationConverter.convertShardingSphereAppender(yamlConfig.getAppenders()));
if (null == result.getLoggers()) {
result = getDefaultLoggingRuleConfiguration();
}
return result;
}
private LoggingRuleConfiguration getDefaultLoggingRuleConfiguration() {
return new DefaultLoggingRuleConfigurationBuilder().build();
}
@Override
public Class&lt;LoggingRuleConfiguration&gt; getTypeClass() {
return LoggingRuleConfiguration.class;
}
@Override
public String getRuleTagName() {
return &quot;LOGGING&quot;;
}
@Override
public int getOrder() {
return LoggingOrder.ORDER;
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L304">304</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L293">293</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return new OtherLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitHexadecimalLiterals(final HexadecimalLiteralsContext ctx) {
// TODO deal with hexadecimalLiterals
return new OtherLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitBitValueLiterals(final BitValueLiteralsContext ctx) {
// TODO deal with bitValueLiterals
return new OtherLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitBooleanLiterals(final BooleanLiteralsContext ctx) {
return new BooleanLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitNullValueLiterals(final NullValueLiteralsContext ctx) {
return new NullLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitIdentifier(final IdentifierContext ctx) {
return new IdentifierValue(ctx.getText());</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L1412">1412</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.html#L123">123</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>} else {
result.setInsertColumns(new InsertColumnsSegment(ctx.start.getStartIndex() - 1, ctx.start.getStartIndex() - 1, Collections.emptyList()));
}
result.getValues().addAll(createInsertValuesSegments(ctx.assignmentValues()));
return result;
}
private Collection&lt;InsertValuesSegment&gt; createInsertValuesSegments(final Collection&lt;AssignmentValuesContext&gt; assignmentValuesContexts) {
Collection&lt;InsertValuesSegment&gt; result = new LinkedList&lt;&gt;();
for (AssignmentValuesContext each : assignmentValuesContexts) {
result.add((InsertValuesSegment) visit(each));
}
return result;
}
@Override
public ASTNode visitOnDuplicateKeyClause(final OnDuplicateKeyClauseContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/type/MySQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/type/MySQLDDLStatementVisitor.html#L253">253</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L265">265</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L338">338</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>MySQLCreateTableStatement result = new MySQLCreateTableStatement(null != ctx.ifNotExists());
result.setTable((SimpleTableSegment) visit(ctx.tableName()));
if (null != ctx.createDefinitionClause()) {
CollectionValue&lt;CreateDefinitionSegment&gt; createDefinitions = (CollectionValue&lt;CreateDefinitionSegment&gt;) visit(ctx.createDefinitionClause());
for (CreateDefinitionSegment each : createDefinitions.getValue()) {
if (each instanceof ColumnDefinitionSegment) {
result.getColumnDefinitions().add((ColumnDefinitionSegment) each);
} else if (each instanceof ConstraintDefinitionSegment) {
result.getConstraintDefinitions().add((ConstraintDefinitionSegment) each);
}
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.html#L385">385</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.html#L68">68</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OracleCreateTableStatement result = new OracleCreateTableStatement();
result.setTable((SimpleTableSegment) visit(ctx.tableName()));
if (null != ctx.createDefinitionClause()) {
CollectionValue&lt;CreateDefinitionSegment&gt; createDefinitions = (CollectionValue&lt;CreateDefinitionSegment&gt;) visit(ctx.createDefinitionClause());
for (CreateDefinitionSegment each : createDefinitions.getValue()) {
if (each instanceof ColumnDefinitionSegment) {
result.getColumnDefinitions().add((ColumnDefinitionSegment) each);
} else if (each instanceof ConstraintDefinitionSegment) {
result.getConstraintDefinitions().add((ConstraintDefinitionSegment) each);
}
}
}
return result;
}
@Override
public ASTNode visitCreateType(final CreateTypeContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/infra/binder/segment/expression/impl/BinaryOperationExpressionBinder.java</td>
<td>shardingsphere-infra-binder</td>
<td><a href="./xref/org/apache/shardingsphere/infra/binder/segment/expression/impl/BinaryOperationExpressionBinder.html#L35">35</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/infra/binder/segment/parameter/impl/ParameterMarkerExpressionSegmentBinder.java</td>
<td>shardingsphere-infra-binder</td>
<td><a href="./xref/org/apache/shardingsphere/infra/binder/segment/parameter/impl/ParameterMarkerExpressionSegmentBinder.html#L38">38</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final class BinaryOperationExpressionBinder {
/**
* Bind binary operation expression with metadata.
*
* @param segment binary operation expression segment
* @param parentSegmentType parent segment type
* @param statementBinderContext statement binder context
* @param tableBinderContexts table binder contexts
* @param outerTableBinderContexts outer table binder contexts
* @return bounded binary operation expression segment
*/
public static BinaryOperationExpression bind(final BinaryOperationExpression segment, final SegmentType parentSegmentType, final SQLStatementBinderContext statementBinderContext,
final Map&lt;String, TableSegmentBinderContext&gt; tableBinderContexts, final Map&lt;String, TableSegmentBinderContext&gt; outerTableBinderContexts) {
ExpressionSegment boundedLeft = ExpressionSegmentBinder.bind(segment.getLeft(), parentSegmentType, statementBinderContext, tableBinderContexts, outerTableBinderContexts);
ExpressionSegment boundedRight = ExpressionSegmentBinder.bind(segment.getRight(), parentSegmentType, statementBinderContext, tableBinderContexts, outerTableBinderContexts);
return new BinaryOperationExpression(segment.getStartIndex(), segment.getStopIndex(), boundedLeft, boundedRight, segment.getOperator(), segment.getText());
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L304">304</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L281">281</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L150">150</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>return new OtherLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitHexadecimalLiterals(final HexadecimalLiteralsContext ctx) {
// TODO deal with hexadecimalLiterals
return new OtherLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitBitValueLiterals(final BitValueLiteralsContext ctx) {
// TODO deal with bitValueLiterals
return new OtherLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitBooleanLiterals(final BooleanLiteralsContext ctx) {
return new BooleanLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitNullValueLiterals(final NullValueLiteralsContext ctx) {
return new NullLiteralValue(ctx.getText());
}
@Override
public final ASTNode visitIdentifier(final IdentifierContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L265">265</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.html#L385">385</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L338">338</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussCreateTableStatement result = new OpenGaussCreateTableStatement(null != ctx.ifNotExists());
result.setTable((SimpleTableSegment) visit(ctx.tableName()));
if (null != ctx.createDefinitionClause()) {
CollectionValue&lt;CreateDefinitionSegment&gt; createDefinitions = (CollectionValue&lt;CreateDefinitionSegment&gt;) visit(ctx.createDefinitionClause());
for (CreateDefinitionSegment each : createDefinitions.getValue()) {
if (each instanceof ColumnDefinitionSegment) {
result.getColumnDefinitions().add((ColumnDefinitionSegment) each);
} else if (each instanceof ConstraintDefinitionSegment) {
result.getConstraintDefinitions().add((ConstraintDefinitionSegment) each);
}
}
}
return result;
}
@Override
public ASTNode visitCreateDefinitionClause(final CreateDefinitionClauseContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/infra/database/h2/metadata/data/loader/H2MetaDataLoader.java</td>
<td>shardingsphere-infra-database-h2</td>
<td><a href="./xref/org/apache/shardingsphere/infra/database/h2/metadata/data/loader/H2MetaDataLoader.html#L72">72</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/infra/database/sqlserver/metadata/data/loader/SQLServerMetaDataLoader.java</td>
<td>shardingsphere-infra-database-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/infra/database/sqlserver/metadata/data/loader/SQLServerMetaDataLoader.html#L72">72</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>Map&lt;String, Collection&lt;IndexMetaData&gt;&gt; indexMetaDataMap = columnMetaDataMap.isEmpty() ? Collections.emptyMap() : loadIndexMetaData(connection, columnMetaDataMap.keySet());
for (Entry&lt;String, Collection&lt;ColumnMetaData&gt;&gt; entry : columnMetaDataMap.entrySet()) {
Collection&lt;IndexMetaData&gt; indexMetaDataList = indexMetaDataMap.getOrDefault(entry.getKey(), Collections.emptyList());
tableMetaDataList.add(new TableMetaData(entry.getKey(), entry.getValue(), indexMetaDataList, Collections.emptyList()));
}
}
return Collections.singleton(new SchemaMetaData(material.getDefaultSchemaName(), tableMetaDataList));
}
private Map&lt;String, Collection&lt;ColumnMetaData&gt;&gt; loadColumnMetaDataMap(final Connection connection, final Collection&lt;String&gt; tables) throws SQLException {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L668">668</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L1224">1224</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L668">668</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L541">541</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L921">921</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>result.setStartIndex(ctx.start.getStartIndex());
result.setStopIndex(ctx.stop.getStopIndex());
if (null != ctx.dataTypeLength()) {
DataTypeLengthSegment dataTypeLengthSegment = (DataTypeLengthSegment) visit(ctx.dataTypeLength());
result.setDataLength(dataTypeLengthSegment);
}
return result;
}
@Override
public final ASTNode visitDataTypeLength(final DataTypeLengthContext ctx) {
DataTypeLengthSegment result = new DataTypeLengthSegment();
result.setStartIndex(ctx.start.getStartIndex());
result.setStopIndex(ctx.stop.getStartIndex());
List&lt;TerminalNode&gt; numbers = ctx.NUMBER_();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L841">841</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L954">954</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussCreateSchemaStatement result = new OpenGaussCreateSchemaStatement();
if (null != ctx.createSchemaClauses().colId()) {
result.setSchemaName(new IdentifierValue(ctx.createSchemaClauses().colId().getText()));
}
if (null != ctx.createSchemaClauses().roleSpec() &amp;&amp; null != ctx.createSchemaClauses().roleSpec().identifier()) {
result.setUsername((IdentifierValue) visit(ctx.createSchemaClauses().roleSpec().identifier()));
}
return result;
}
@Override
public ASTNode visitAlterSchema(final AlterSchemaContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L992">992</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L457">457</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>for (ExprContext each : exprList) {
result.add((ExpressionSegment) visit(each));
}
return result;
}
private String getDistinctExpression(final AggregationFunctionContext ctx) {
StringBuilder result = new StringBuilder();
for (int i = 3; i &lt; ctx.getChildCount() - 1; i++) {
result.append(ctx.getChild(i).getText());
}
return result.toString();
}
@Override
public final ASTNode visitSpecialFunction(final SpecialFunctionContext ctx) {
if (null != ctx.castFunction()) {
return visit(ctx.castFunction());
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/rewrite/condition/impl/EncryptBinaryCondition.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rewrite/condition/impl/EncryptBinaryCondition.html#L79">79</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/encrypt/rewrite/condition/impl/EncryptInCondition.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/rewrite/condition/impl/EncryptInCondition.html#L71">71</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
}
@Override
public List&lt;Object&gt; getValues(final List&lt;Object&gt; params) {
List&lt;Object&gt; result = new ArrayList&lt;&gt;(positionValueMap.values());
for (Entry&lt;Integer, Integer&gt; entry : positionIndexMap.entrySet()) {
Object param = params.get(entry.getValue());
if (entry.getKey() &lt; result.size()) {
result.add(entry.getKey(), param);
} else {
result.add(param);
}
}
return result;
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/infra/database/opengauss/metadata/data/loader/OpenGaussMetaDataLoader.java</td>
<td>shardingsphere-infra-database-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/infra/database/opengauss/metadata/data/loader/OpenGaussMetaDataLoader.html#L139">139</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/infra/database/postgresql/metadata/data/loader/PostgreSQLMetaDataLoader.java</td>
<td>shardingsphere-infra-database-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/infra/database/postgresql/metadata/data/loader/PostgreSQLMetaDataLoader.html#L170">170</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
private String getColumnMetaDataSQL(final Collection&lt;String&gt; schemaNames, final Collection&lt;String&gt; tables) {
String schemaNameParam = schemaNames.stream().map(each -&gt; String.format(&quot;'%s'&quot;, each)).collect(Collectors.joining(&quot;,&quot;));
return tables.isEmpty() ? String.format(TABLE_META_DATA_SQL_WITHOUT_TABLES, schemaNameParam)
: String.format(TABLE_META_DATA_SQL_WITH_TABLES, schemaNameParam, tables.stream().map(each -&gt; String.format(&quot;'%s'&quot;, each)).collect(Collectors.joining(&quot;,&quot;)));
}
private Collection&lt;String&gt; loadPrimaryKeys(final Connection connection, final Collection&lt;String&gt; schemaNames) throws SQLException {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/authority/yaml/swapper/YamlAuthorityDataNodeRuleConfigurationSwapper.java</td>
<td>shardingsphere-authority-core</td>
<td><a href="./xref/org/apache/shardingsphere/authority/yaml/swapper/YamlAuthorityDataNodeRuleConfigurationSwapper.html#L53">53</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/authority/yaml/swapper/YamlAuthorityRuleConfigurationSwapper.java</td>
<td>shardingsphere-authority-core</td>
<td><a href="./xref/org/apache/shardingsphere/authority/yaml/swapper/YamlAuthorityRuleConfigurationSwapper.html#L44">44</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private YamlAuthorityRuleConfiguration swapToYamlConfiguration(final AuthorityRuleConfiguration data) {
YamlAuthorityRuleConfiguration result = new YamlAuthorityRuleConfiguration();
result.setPrivilege(algorithmSwapper.swapToYamlConfiguration(data.getPrivilegeProvider()));
result.setUsers(data.getUsers().stream().map(userSwapper::swapToYamlConfiguration).collect(Collectors.toList()));
result.setDefaultAuthenticator(data.getDefaultAuthenticator());
data.getAuthenticators().forEach((key, value) -&gt; result.getAuthenticators().put(key, algorithmSwapper.swapToYamlConfiguration(value)));
return result;
}
@Override
public Optional&lt;AuthorityRuleConfiguration&gt; swapToObject(final Collection&lt;YamlDataNode&gt; dataNodes) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/parser/yaml/swapper/YamlSQLParserDataNodeRuleConfigurationSwapper.java</td>
<td>shardingsphere-sql-parser-core</td>
<td><a href="./xref/org/apache/shardingsphere/parser/yaml/swapper/YamlSQLParserDataNodeRuleConfigurationSwapper.html#L65">65</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/parser/yaml/swapper/YamlSQLParserRuleConfigurationSwapper.java</td>
<td>shardingsphere-sql-parser-core</td>
<td><a href="./xref/org/apache/shardingsphere/parser/yaml/swapper/YamlSQLParserRuleConfigurationSwapper.html#L43">43</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private SQLParserRuleConfiguration swapToObject(final YamlSQLParserRuleConfiguration yamlConfig) {
CacheOption parseTreeCacheOption = null == yamlConfig.getParseTreeCache()
? DefaultSQLParserRuleConfigurationBuilder.PARSE_TREE_CACHE_OPTION
: cacheOptionSwapper.swapToObject(yamlConfig.getParseTreeCache());
CacheOption sqlStatementCacheOption = null == yamlConfig.getSqlStatementCache()
? DefaultSQLParserRuleConfigurationBuilder.SQL_STATEMENT_CACHE_OPTION
: cacheOptionSwapper.swapToObject(yamlConfig.getSqlStatementCache());
return new SQLParserRuleConfiguration(parseTreeCacheOption, sqlStatementCacheOption);
}
@Override
public Class&lt;SQLParserRuleConfiguration&gt; getTypeClass() {
return SQLParserRuleConfiguration.class;
}
@Override
public String getRuleTagName() {
return &quot;SQL_PARSER&quot;;
}
@Override
public int getOrder() {
return SQLParserOrder.ORDER;
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/OpenGaussOptimizerBuilder.java</td>
<td>shardingsphere-sql-federation-optimizer</td>
<td><a href="./xref/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/OpenGaussOptimizerBuilder.html#L31">31</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/PostgreSQLOptimizerBuilder.java</td>
<td>shardingsphere-sql-federation-optimizer</td>
<td><a href="./xref/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/PostgreSQLOptimizerBuilder.html#L31">31</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final class OpenGaussOptimizerBuilder implements OptimizerSQLDialectBuilder {
@Override
public Properties build() {
Properties result = new Properties();
result.setProperty(CalciteConnectionProperty.LEX.camelName(), Lex.JAVA.name());
result.setProperty(CalciteConnectionProperty.CONFORMANCE.camelName(), SqlConformanceEnum.BABEL.name());
result.setProperty(CalciteConnectionProperty.FUN.camelName(), SqlLibrary.POSTGRESQL.fun);
result.setProperty(CalciteConnectionProperty.CASE_SENSITIVE.camelName(), String.valueOf(false));
return result;
}
@Override
public String getDatabaseType() {
return &quot;openGauss&quot;;</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/transaction/xa/jta/connection/dialect/MariaDBXAConnectionWrapper.java</td>
<td>shardingsphere-transaction-xa-core</td>
<td><a href="./xref/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/MariaDBXAConnectionWrapper.html#L33">33</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/transaction/xa/jta/connection/dialect/OpenGaussXAConnectionWrapper.java</td>
<td>shardingsphere-transaction-xa-core</td>
<td><a href="./xref/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/OpenGaussXAConnectionWrapper.html#L33">33</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/transaction/xa/jta/connection/dialect/OracleXAConnectionWrapper.java</td>
<td>shardingsphere-transaction-xa-core</td>
<td><a href="./xref/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/OracleXAConnectionWrapper.html#L33">33</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/transaction/xa/jta/connection/dialect/PostgreSQLXAConnectionWrapper.java</td>
<td>shardingsphere-transaction-xa-core</td>
<td><a href="./xref/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/PostgreSQLXAConnectionWrapper.html#L33">33</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final class MariaDBXAConnectionWrapper implements XAConnectionWrapper {
private Class&lt;Connection&gt; jdbcConnectionClass;
private Constructor&lt;?&gt; xaConnectionConstructor;
@Override
public XAConnection wrap(final XADataSource xaDataSource, final Connection connection) throws SQLException {
return createXAConnection(connection.unwrap(jdbcConnectionClass));
}
@Override
public void init(final Properties props) {
loadReflection();
}
private void loadReflection() {
jdbcConnectionClass = getJDBCConnectionClass();
xaConnectionConstructor = getXAConnectionConstructor();
}
@SuppressWarnings(&quot;unchecked&quot;)
@SneakyThrows(ReflectiveOperationException.class)
private Class&lt;Connection&gt; getJDBCConnectionClass() {
return (Class&lt;Connection&gt;) Class.forName(&quot;org.mariadb.jdbc.MariaDbConnection&quot;);</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L269">269</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L265">265</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return visit(ctx.temporalLiterals());
}
if (null != ctx.hexadecimalLiterals()) {
return visit(ctx.hexadecimalLiterals());
}
if (null != ctx.bitValueLiterals()) {
return visit(ctx.bitValueLiterals());
}
if (null != ctx.booleanLiterals()) {
return visit(ctx.booleanLiterals());
}
if (null != ctx.nullValueLiterals()) {
return visit(ctx.nullValueLiterals());
}
throw new IllegalStateException(&quot;Literals must have string, number, dateTime, hex, bit, boolean or null.&quot;);
}
@Override
public final ASTNode visitStringLiterals(final StringLiteralsContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L587">587</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L570">570</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L351">351</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L550">550</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return visit(ctx.simpleExpr());
}
ExpressionSegment left = (ExpressionSegment) visit(ctx.getChild(0));
ExpressionSegment right = (ExpressionSegment) visit(ctx.getChild(2));
String operator = ctx.getChild(1).getText();
String text = ctx.start.getInputStream().getText(new Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return new BinaryOperationExpression(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), left, right, operator, text);
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDMLStatementVisitor.html#L100">100</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDMLStatementVisitor.html#L129">129</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public ASTNode visitCopyWithTableOrQuery(final CopyWithTableOrQueryContext ctx) {
PostgreSQLCopyStatement result = new PostgreSQLCopyStatement();
if (null != ctx.qualifiedName()) {
result.setTableSegment((SimpleTableSegment) visit(ctx.qualifiedName()));
if (null != ctx.columnNames()) {
result.getColumns().addAll(((CollectionValue&lt;ColumnSegment&gt;) visit(ctx.columnNames())).getValue());
}
}
if (null != ctx.preparableStmt()) {
result.setPrepareStatementQuerySegment(extractPrepareStatementQuerySegmentFromPreparableStmt(ctx.preparableStmt()));
}
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/ShowEventsStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/ShowEventsStatementAssert.html#L42">42</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/ShowOpenTablesStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/ShowOpenTablesStatementAssert.html#L42">42</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/ShowTableStatusStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/ShowTableStatusStatementAssert.html#L42">42</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/ShowTablesStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/ShowTablesStatementAssert.html#L42">42</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/ShowTriggersStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/impl/ShowTriggersStatementAssert.html#L42">42</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLShowEventsStatement actual, final ShowEventsStatementTestCase expected) {
if (actual.getFromSchema().isPresent()) {
DatabaseAssert.assertIs(assertContext, actual.getFromSchema().get().getSchema(), expected.getFromSchema().getSchema());
SQLSegmentAssert.assertIs(assertContext, actual.getFromSchema().get(), expected.getFromSchema());
}
if (actual.getFilter().isPresent()) {
ShowFilterAssert.assertIs(assertContext, actual.getFilter().get(), expected.getFilter());
}
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/impl/AlterShadowRuleStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/alter/impl/AlterShadowRuleStatementAssert.html#L51">51</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/impl/CreateShadowRuleStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/rdl/create/impl/CreateShadowRuleStatementAssert.html#L54">54</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>assertShadowRule(assertContext, actual.getRules(), expected.getRules());
}
}
private static void assertShadowRule(final SQLCaseAssertContext assertContext, final Collection&lt;ShadowRuleSegment&gt; actual, final List&lt;ExpectedShadowRule&gt; expected) {
if (null == expected) {
assertNull(actual, assertContext.getText(&quot;Actual shadow rule should not exist.&quot;));
} else {
assertNotNull(actual, assertContext.getText(&quot;Actual shadow rule should exist.&quot;));
int count = 0;
for (ShadowRuleSegment each : actual) {
ShadowRuleAssert.assertIs(assertContext, each, expected.get(count));
count++;
}
}
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L980">980</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L950">950</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>private SubquerySegment createSubquerySegment(final SelectClauseNContext ctx, final OpenGaussSelectStatement selectStatement) {
return new SubquerySegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), selectStatement, getOriginalText(ctx));
}
private CombineType getCombineType(final SelectClauseNContext ctx) {
boolean isDistinct = null == ctx.allOrDistinct() || null != ctx.allOrDistinct().DISTINCT();
if (null != ctx.UNION()) {
return isDistinct ? CombineType.UNION : CombineType.UNION_ALL;
}
if (null != ctx.INTERSECT()) {
return isDistinct ? CombineType.INTERSECT : CombineType.INTERSECT_ALL;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.html#L251">251</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/SQL92StatementVisitor.html#L111">111</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L250">250</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>public abstract class MySQLStatementVisitor extends MySQLStatementBaseVisitor&lt;ASTNode&gt; {
private final Collection&lt;ParameterMarkerSegment&gt; parameterMarkerSegments = new LinkedList&lt;&gt;();
@Override
public final ASTNode visitParameterMarker(final ParameterMarkerContext ctx) {
return new ParameterMarkerValue(parameterMarkerSegments.size(), ParameterMarkerType.QUESTION);
}
@Override
public final ASTNode visitLiterals(final LiteralsContext ctx) {
if (null != ctx.stringLiterals()) {
return visit(ctx.stringLiterals());
}
if (null != ctx.numberLiterals()) {
return visit(ctx.numberLiterals());
}
if (null != ctx.temporalLiterals()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/mysql/visitor/statement/type/MySQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-mysql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/type/MySQLDDLStatementVisitor.html#L253">253</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDDLStatementVisitor.html#L385">385</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.html#L68">68</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>MySQLCreateTableStatement result = new MySQLCreateTableStatement(null != ctx.ifNotExists());
result.setTable((SimpleTableSegment) visit(ctx.tableName()));
if (null != ctx.createDefinitionClause()) {
CollectionValue&lt;CreateDefinitionSegment&gt; createDefinitions = (CollectionValue&lt;CreateDefinitionSegment&gt;) visit(ctx.createDefinitionClause());
for (CreateDefinitionSegment each : createDefinitions.getValue()) {
if (each instanceof ColumnDefinitionSegment) {
result.getColumnDefinitions().add((ColumnDefinitionSegment) each);
} else if (each instanceof ConstraintDefinitionSegment) {
result.getConstraintDefinitions().add((ConstraintDefinitionSegment) each);
}
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L674">674</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L817">817</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>OpenGaussAlterViewStatement result = new OpenGaussAlterViewStatement();
result.setView((SimpleTableSegment) visit(ctx.qualifiedName()));
if (ctx.alterViewClauses() instanceof AlterRenameViewContext) {
NameContext nameContext = ((AlterRenameViewContext) ctx.alterViewClauses()).name();
result.setRenameView(
new SimpleTableSegment(new TableNameSegment(nameContext.getStart().getStartIndex(), nameContext.getStop().getStopIndex(), (IdentifierValue) visit(nameContext.identifier()))));
}
return result;
}
@Override
public ASTNode visitDropDatabase(final DropDatabaseContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/merge/dal/show/EncryptShowColumnsMergedResult.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/merge/dal/show/EncryptShowColumnsMergedResult.html#L89">89</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/encrypt/merge/dal/show/EncryptShowCreateTableMergedResult.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/merge/dal/show/EncryptShowCreateTableMergedResult.html#L98">98</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>return getOriginalValue(columnIndex, type);
}
@Override
public final Object getCalendarValue(final int columnIndex, final Class&lt;?&gt; type, final Calendar calendar) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;&quot;);
}
@Override
public final InputStream getInputStream(final int columnIndex, final String type) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;&quot;);
}
@Override
public Reader getCharacterStream(final int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException(&quot;&quot;);
}
protected abstract boolean nextValue() throws SQLException;
protected abstract Object getOriginalValue(int columnIndex, Class&lt;?&gt; type) throws SQLException;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java</td>
<td>shardingsphere-jdbc</td>
<td><a href="./xref/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.html#L273">273</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java</td>
<td>shardingsphere-jdbc</td>
<td><a href="./xref/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.html#L470">470</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
private void handleAutoCommit(final QueryContext queryContext) throws SQLException {
if (AutoCommitUtils.needOpenTransaction(queryContext.getSqlStatementContext().getSqlStatement())) {
connection.handleAutoCommit();
}
}
private JDBCExecutionUnit createTrafficExecutionUnit(final String trafficInstanceId, final QueryContext queryContext) throws SQLException {
DriverExecutionPrepareEngine&lt;JDBCExecutionUnit, Connection&gt; prepareEngine = createDriverExecutionPrepareEngine();
ExecutionUnit executionUnit = new ExecutionUnit(trafficInstanceId, new SQLUnit(queryContext.getSql(), queryContext.getParameters()));
ExecutionGroupContext&lt;JDBCExecutionUnit&gt; context =
prepareEngine.prepare(new RouteContext(), Collections.singleton(executionUnit), new ExecutionGroupReportContext(connection.getProcessId(), databaseName, new Grantee(&quot;&quot;, &quot;&quot;)));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql/common/util/SQLUtils.java</td>
<td>shardingsphere-parser-sql-statement</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql/common/util/SQLUtils.html#L75">75</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql/common/value/literal/impl/NumberLiteralValue.java</td>
<td>shardingsphere-parser-sql-statement</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql/common/value/literal/impl/NumberLiteralValue.html#L48">48</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>BigInteger result = new BigInteger(value, radix);
if (result.compareTo(new BigInteger(String.valueOf(Integer.MIN_VALUE))) &gt;= 0 &amp;&amp; result.compareTo(new BigInteger(String.valueOf(Integer.MAX_VALUE))) &lt;= 0) {
return result.intValue();
}
if (result.compareTo(new BigInteger(String.valueOf(Long.MIN_VALUE))) &gt;= 0 &amp;&amp; result.compareTo(new BigInteger(String.valueOf(Long.MAX_VALUE))) &lt;= 0) {
return result.longValue();
}
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dcl/impl/AlterLoginStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dcl/impl/AlterLoginStatementAssert.html#L45">45</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dcl/impl/CreateLoginStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dcl/impl/CreateLoginStatementAssert.html#L45">45</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dcl/impl/DropLoginStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dcl/impl/DropLoginStatementAssert.html#L45">45</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>public static void assertIs(final SQLCaseAssertContext assertContext, final SQLServerAlterLoginStatement actual, final AlterLoginStatementTestCase expected) {
if (null == expected.getLogin()) {
assertNull(actual.getLoginSegment(), assertContext.getText(&quot;Actual login should not exist.&quot;));
} else {
assertNotNull(actual.getLoginSegment(), assertContext.getText(&quot;Actual login should exist.&quot;));
assertThat(assertContext.getText(&quot;Login name assertion error: &quot;), actual.getLoginSegment().getLoginName().getValueWithQuoteCharacters(), is(expected.getLogin().getName()));
SQLSegmentAssert.assertIs(assertContext, actual.getLoginSegment(), expected.getLogin());
}
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/encrypt/merge/dql/EncryptMergedResult.java</td>
<td>shardingsphere-encrypt-core</td>
<td><a href="./xref/org/apache/shardingsphere/encrypt/merge/dql/EncryptMergedResult.html#L78">78</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/mask/merge/dql/MaskMergedResult.java</td>
<td>shardingsphere-mask-core</td>
<td><a href="./xref/org/apache/shardingsphere/mask/merge/dql/MaskMergedResult.html#L68">68</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>}
@Override
public Object getCalendarValue(final int columnIndex, final Class&lt;?&gt; type, final Calendar calendar) throws SQLException {
return mergedResult.getCalendarValue(columnIndex, type, calendar);
}
@Override
public InputStream getInputStream(final int columnIndex, final String type) throws SQLException {
return mergedResult.getInputStream(columnIndex, type);
}
@Override
public Reader getCharacterStream(final int columnIndex) throws SQLException {
return mergedResult.getCharacterStream(columnIndex);
}
@Override
public boolean wasNull() throws SQLException {
return mergedResult.wasNull();
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sharding/rule/changed/DefaultDatabaseShardingStrategyChangedProcessor.java</td>
<td>shardingsphere-sharding-core</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/rule/changed/DefaultDatabaseShardingStrategyChangedProcessor.html#L35">35</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sharding/rule/changed/DefaultTableShardingStrategyChangedProcessor.java</td>
<td>shardingsphere-sharding-core</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/rule/changed/DefaultTableShardingStrategyChangedProcessor.html#L35">35</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public final class DefaultDatabaseShardingStrategyChangedProcessor implements RuleItemConfigurationChangedProcessor&lt;ShardingRuleConfiguration, ShardingStrategyConfiguration&gt; {
@Override
public ShardingStrategyConfiguration swapRuleItemConfiguration(final AlterRuleItemEvent event, final String yamlContent) {
return new YamlShardingStrategyConfigurationSwapper().swapToObject(YamlEngine.unmarshal(yamlContent, YamlShardingStrategyConfiguration.class));
}
@Override
public ShardingRuleConfiguration findRuleConfiguration(final ShardingSphereDatabase database) {
return database.getRuleMetaData().findSingleRule(ShardingRule.class).map(ShardingRule::getConfiguration).orElseGet(ShardingRuleConfiguration::new);
}
@Override
public void changeRuleItemConfiguration(final AlterRuleItemEvent event, final ShardingRuleConfiguration currentRuleConfig, final ShardingStrategyConfiguration toBeChangedItemConfig) {
currentRuleConfig.setDefaultDatabaseShardingStrategy(toBeChangedItemConfig);</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sharding/rule/changed/KeyGeneratorChangedProcessor.java</td>
<td>shardingsphere-sharding-core</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/rule/changed/KeyGeneratorChangedProcessor.html#L37">37</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sharding/rule/changed/ShardingAlgorithmChangedProcessor.java</td>
<td>shardingsphere-sharding-core</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/rule/changed/ShardingAlgorithmChangedProcessor.html#L37">37</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sharding/rule/changed/ShardingAuditorChangedProcessor.java</td>
<td>shardingsphere-sharding-core</td>
<td><a href="./xref/org/apache/shardingsphere/sharding/rule/changed/ShardingAuditorChangedProcessor.html#L37">37</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>public final class KeyGeneratorChangedProcessor implements RuleItemConfigurationChangedProcessor&lt;ShardingRuleConfiguration, AlgorithmConfiguration&gt; {
@Override
public AlgorithmConfiguration swapRuleItemConfiguration(final AlterRuleItemEvent event, final String yamlContent) {
return new YamlAlgorithmConfigurationSwapper().swapToObject(YamlEngine.unmarshal(yamlContent, YamlAlgorithmConfiguration.class));
}
@Override
public ShardingRuleConfiguration findRuleConfiguration(final ShardingSphereDatabase database) {
return database.getRuleMetaData().findSingleRule(ShardingRule.class).map(ShardingRule::getConfiguration).orElseGet(ShardingRuleConfiguration::new);
}
@Override
public void changeRuleItemConfiguration(final AlterRuleItemEvent event, final ShardingRuleConfiguration currentRuleConfig, final AlgorithmConfiguration toBeChangedItemConfig) {
currentRuleConfig.getKeyGenerators().put(((AlterNamedRuleItemEvent) event).getItemName(), toBeChangedItemConfig);</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L255">255</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.html#L366">366</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L255">255</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>ColumnSegment result = new ColumnSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), (IdentifierValue) visit(ctx.name()));
OwnerContext owner = ctx.owner();
if (null != owner) {
result.setOwner(new OwnerSegment(owner.getStart().getStartIndex(), owner.getStop().getStopIndex(), (IdentifierValue) visit(owner.identifier())));
}
return result;
}
@Override
public final ASTNode visitIndexName(final IndexNameContext ctx) {
IndexNameSegment indexName = new IndexNameSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), (IdentifierValue) visit(ctx.identifier()));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L737">737</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L741">741</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>AttrNameContext attrName = ctx.indirection().indirectionEl().attrName();
TableNameSegment tableName = new TableNameSegment(attrName.start.getStartIndex(), attrName.stop.getStopIndex(), new IdentifierValue(attrName.getText()));
OwnerSegment owner = new OwnerSegment(ctx.colId().start.getStartIndex(), ctx.colId().stop.getStopIndex(), new IdentifierValue(ctx.colId().getText()));
SimpleTableSegment result = new SimpleTableSegment(tableName);
if (null == ctx.indirection().indirection()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.html#L261">261</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.html#L296">296</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>if (null != ctx.selectSubquery()) {
SubquerySegment subquerySegment = new SubquerySegment(ctx.selectSubquery().start.getStartIndex(), ctx.selectSubquery().stop.getStopIndex(),
(OracleSelectStatement) visit(ctx.selectSubquery()), getOriginalText(ctx.selectSubquery()));
SubqueryExpressionSegment value = new SubqueryExpressionSegment(subquerySegment);
ColumnAssignmentSegment result = new ColumnAssignmentSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), columnSegments, value);
result.getColumns().add(column);
return result;
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/shadow/route/engine/dml/ShadowDeleteStatementRoutingEngine.java</td>
<td>shardingsphere-shadow-core</td>
<td><a href="./xref/org/apache/shardingsphere/shadow/route/engine/dml/ShadowDeleteStatementRoutingEngine.html#L52">52</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/shadow/route/engine/dml/ShadowUpdateStatementRoutingEngine.java</td>
<td>shardingsphere-shadow-core</td>
<td><a href="./xref/org/apache/shardingsphere/shadow/route/engine/dml/ShadowUpdateStatementRoutingEngine.html#L58">58</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>ShadowExtractor.extractValues(each, parameters).map(values -&gt; new ShadowColumnCondition(getSingleTableName(), shadowColumnName, values)).ifPresent(result::add);
}
return result;
}
private Collection&lt;ExpressionSegment&gt; getWhereSegment() {
Collection&lt;ExpressionSegment&gt; result = new LinkedList&lt;&gt;();
for (WhereSegment each : sqlStatementContext.getWhereSegments()) {
for (AndPredicate predicate : ExpressionExtractUtils.getAndPredicates(each.getExpr())) {
result.addAll(predicate.getPredicates());
}
}
return result;
}
}</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/metadata/persist/service/config/database/datasource/DataSourceNodePersistService.java</td>
<td>shardingsphere-metadata-core</td>
<td><a href="./xref/org/apache/shardingsphere/metadata/persist/service/config/database/datasource/DataSourceNodePersistService.html#L66">66</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/metadata/persist/service/config/database/datasource/DataSourceUnitPersistService.java</td>
<td>shardingsphere-metadata-core</td>
<td><a href="./xref/org/apache/shardingsphere/metadata/persist/service/config/database/datasource/DataSourceUnitPersistService.html#L66">66</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>String dataSourceValue = repository.getDirectly(DataSourceMetaDataNode.getDataSourceNodeVersionNode(databaseName, each, getDataSourceActiveVersion(databaseName, each)));
if (!Strings.isNullOrEmpty(dataSourceValue)) {
result.put(each, new YamlDataSourceConfigurationSwapper().swapToDataSourcePoolProperties(YamlEngine.unmarshal(dataSourceValue, Map.class)));
}
}
return result;
}
@SuppressWarnings(&quot;unchecked&quot;)
@Override
public Map&lt;String, DataSourcePoolProperties&gt; load(final String databaseName, final String name) {
Map&lt;String, DataSourcePoolProperties&gt; result = new LinkedHashMap&lt;&gt;();
String dataSourceValue = repository.getDirectly(DataSourceMetaDataNode.getDataSourceNodeVersionNode(databaseName, name, getDataSourceActiveVersion(databaseName, name)));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.html#L841">841</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.html#L314">314</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L1513">1513</a></td></tr>
<tr class="a">
<td colspan="3" align="left">
<div class="source">
<pre>if (projection instanceof FunctionSegment) {
FunctionSegment segment = (FunctionSegment) projection;
ExpressionProjectionSegment result = new ExpressionProjectionSegment(segment.getStartIndex(), segment.getStopIndex(), segment.getText(), segment);
result.setAlias(alias);
return result;
}
if (projection instanceof CommonExpressionSegment) {
CommonExpressionSegment segment = (CommonExpressionSegment) projection;
ExpressionProjectionSegment result = new ExpressionProjectionSegment(segment.getStartIndex(), segment.getStopIndex(), segment.getText(), segment);
result.setAlias(alias);
return result;
}
if (projection instanceof XmlQueryAndExistsFunctionSegment || projection instanceof XmlPiFunctionSegment || projection instanceof XmlSerializeFunctionSegment</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DMLStatementVisitor.html#L328">328</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/SQLServerStatementVisitor.html#L1527">1527</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>ExpressionProjectionSegment result = new ExpressionProjectionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(ctx), (ColumnSegment) projection);
result.setAlias(alias);
return result;
}
if (projection instanceof SubqueryExpressionSegment) {
SubqueryExpressionSegment subqueryExpressionSegment = (SubqueryExpressionSegment) projection;
String text = ctx.start.getInputStream().getText(new Interval(subqueryExpressionSegment.getStartIndex(), subqueryExpressionSegment.getStopIndex()));
SubqueryProjectionSegment result = new SubqueryProjectionSegment(((SubqueryExpressionSegment) projection).getSubquery(), text);
result.setAlias(alias);
return result;
}
if (projection instanceof BinaryOperationExpression) {
BinaryOperationExpression binaryExpression = (BinaryOperationExpression) projection;
int startIndex = binaryExpression.getStartIndex();</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportMetaDataExecutor.java</td>
<td>shardingsphere-proxy-backend-core</td>
<td><a href="./xref/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportMetaDataExecutor.html#L62">62</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportStorageNodesExecutor.java</td>
<td>shardingsphere-proxy-backend-core</td>
<td><a href="./xref/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportStorageNodesExecutor.html#L56">56</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>String exportedData = generateExportData(contextManager.getMetaDataContexts().getMetaData());
if (sqlStatement.getFilePath().isPresent()) {
String filePath = sqlStatement.getFilePath().get();
ExportUtils.exportToFile(filePath, exportedData);
return Collections.singleton(new LocalDataQueryResultRow(contextManager.getInstanceContext().getInstance().getCurrentInstanceId(), LocalDateTime.now(),
String.format(&quot;Successfully exported to&#xff1a;'%s'&quot;, filePath)));
}
return Collections.singleton(new LocalDataQueryResultRow(
contextManager.getInstanceContext().getInstance().getCurrentInstanceId(), LocalDateTime.now(), Base64.encodeBase64String(exportedData.getBytes())));</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/OpenGaussStatementVisitor.html#L720">720</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.html#L726">726</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>@Override
public ASTNode visitQualifiedNameList(final QualifiedNameListContext ctx) {
CollectionValue&lt;SimpleTableSegment&gt; result = new CollectionValue&lt;&gt;();
if (null != ctx.qualifiedName()) {
result.getValue().add((SimpleTableSegment) visit(ctx.qualifiedName()));
}
if (null != ctx.qualifiedNameList()) {
result.combine((CollectionValue) visit(ctx.qualifiedNameList()));
}
return result;
}
@Override
public ASTNode visitQualifiedName(final QualifiedNameContext ctx) {
if (null == ctx.indirection()) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-opengauss</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/type/OpenGaussDDLStatementVisitor.html#L300">300</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-postgresql</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/type/PostgreSQLDDLStatementVisitor.html#L373">373</a></td></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sql92</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/type/SQL92DDLStatementVisitor.html#L157">157</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/type/SQLServerDDLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-sqlserver</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/type/SQLServerDDLStatementVisitor.html#L228">228</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>for (AlterDefinitionSegment each : ((CollectionValue&lt;AlterDefinitionSegment&gt;) visit(ctx.alterDefinitionClause())).getValue()) {
if (each instanceof AddColumnDefinitionSegment) {
result.getAddColumnDefinitions().add((AddColumnDefinitionSegment) each);
} else if (each instanceof ModifyColumnDefinitionSegment) {
result.getModifyColumnDefinitions().add((ModifyColumnDefinitionSegment) each);
} else if (each instanceof DropColumnDefinitionSegment) {
result.getDropColumnDefinitions().add((DropColumnDefinitionSegment) each);
} else if (each instanceof AddConstraintDefinitionSegment) {
result.getAddConstraintDefinitions().add((AddConstraintDefinitionSegment) each);
} else if (each instanceof ValidateConstraintDefinitionSegment) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.html#L223">223</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.java</td>
<td>shardingsphere-parser-sql-oracle</td>
<td><a href="./xref/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.html#L418">418</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>public ASTNode visitUpdateSpecification(final UpdateSpecificationContext ctx) {
if (null != ctx.dmlTableExprClause().dmlTableClause()) {
return visit(ctx.dmlTableExprClause().dmlTableClause());
}
if (null != ctx.dmlTableExprClause().dmlSubqueryClause()) {
SubquerySegment subquerySegment = (SubquerySegment) visit(ctx.dmlTableExprClause().dmlSubqueryClause());
return new SubqueryTableSegment(subquerySegment);
}
SubquerySegment subquerySegment = (SubquerySegment) visit(ctx.dmlTableExprClause().tableCollectionExpr());
return new SubqueryTableSegment(subquerySegment);
}
@Override
public ASTNode visitUpdateSetClause(final UpdateSetClauseContext ctx) {</pre></div></td></tr></table>
<table border="0" class="bodyTable">
<tr class="a">
<th>File</th>
<th>Project</th>
<th>Line</th></tr>
<tr class="b">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/impl/DeleteStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/impl/DeleteStatementAssert.html#L131">131</a></td></tr>
<tr class="a">
<td align="left">org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/impl/UpdateStatementAssert.java</td>
<td>shardingsphere-test-it-parser</td>
<td><a href="./xref/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/impl/UpdateStatementAssert.html#L101">101</a></td></tr>
<tr class="b">
<td colspan="3" align="left">
<div class="source">
<pre>Optional&lt;LimitSegment&gt; limitSegment = DeleteStatementHandler.getLimitSegment(actual);
if (null == expected.getLimitClause()) {
assertFalse(limitSegment.isPresent(), assertContext.getText(&quot;Actual limit segment should not exist.&quot;));
} else {
assertTrue(limitSegment.isPresent(), assertContext.getText(&quot;Actual limit segment should exist.&quot;));
LimitClauseAssert.assertRowCount(assertContext, limitSegment.get().getRowCount().orElse(null), expected.getLimitClause().getRowCount());
SQLSegmentAssert.assertIs(assertContext, limitSegment.get(), expected.getLimitClause());
}
}</pre></div></td></tr></table></section></section>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">
Copyright &#169; 2024<a href="https://www.apache.org/">The Apache Software Foundation</a>.
. </div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>