This is an automated email from the ASF dual-hosted git repository.
panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new c865d032923 Fis sonar issue in InsertStatementConverter (#28437)
c865d032923 is described below
commit c865d0329230e55777da8ae0262b0515a1ed750b
Author: Zhengqiang Duan <[email protected]>
AuthorDate: Fri Sep 15 08:41:33 2023 +0800
Fis sonar issue in InsertStatementConverter (#28437)
---
.../converter/statement/insert/InsertStatementConverter.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/insert/InsertStatementConverter.java
b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/insert/InsertStatementConverter.java
index 2b717e03087..e10d342e593 100644
---
a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/insert/InsertStatementConverter.java
+++
b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/insert/InsertStatementConverter.java
@@ -68,8 +68,8 @@ public final class InsertStatementConverter implements
SQLStatementConverter<Ins
} else {
source = convertValues(insertStatement.getValues());
}
- SqlNodeList columnList = convertColumn(insertStatement.getColumns());
- return new SqlInsert(SqlParserPos.ZERO, keywords, table, source,
columnList);
+ SqlNodeList columns = convertColumn(insertStatement.getColumns());
+ return new SqlInsert(SqlParserPos.ZERO, keywords, table, source,
columns);
}
private SqlNode convertSelect(final SubquerySegment subquerySegment) {
@@ -97,7 +97,7 @@ public final class InsertStatementConverter implements
SQLStatementConverter<Ins
private SqlNodeList convertColumn(final Collection<ColumnSegment>
columnSegments) {
List<SqlNode> columns = columnSegments.stream().map(each -> new
ColumnConverter().convert(each).orElseThrow(IllegalStateException::new)).collect(Collectors.toList());
if (columns.isEmpty()) {
- return null;
+ return SqlNodeList.EMPTY;
}
return new SqlNodeList(columns, SqlParserPos.ZERO);
}