From 7dd47d5ebae1ecdeaa8d6b5cd5cd5750b426c88f Mon Sep 17 00:00:00 2001 From: Kanha gupta Date: Mon, 25 Sep 2023 18:11:40 +0530 Subject: [PATCH] WithSegment supported --- .../converter/segment/with/WithConverter.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/with/WithConverter.java b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/with/WithConverter.java index cf5ab54ed1aab0..f3d59eae37d4c8 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/with/WithConverter.java +++ b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/with/WithConverter.java @@ -36,14 +36,18 @@ * With converter. */ public final class WithConverter { + /** - * Convert. + * + * @param withSegment with segment + * @param query SqlNode + * @return SqlNodeList */ - public Optional convert(final WithSegment segment, final SqlNode query) { - SqlIdentifier name = new SqlIdentifier(segment.getCommonTableExpressions().iterator().next().getIdentifier().getValue(), SqlParserPos.ZERO); - SqlNode selectSubquery = new SelectStatementConverter().convert(segment.getCommonTableExpressions().iterator().next().getSubquery().getSelect()); + public Optional convert(final WithSegment withSegment, final SqlNode query) { + SqlIdentifier name = new SqlIdentifier(withSegment.getCommonTableExpressions().iterator().next().getIdentifier().getValue(), SqlParserPos.ZERO); + SqlNode selectSubquery = new SelectStatementConverter().convert(withSegment.getCommonTableExpressions().iterator().next().getSubquery().getSelect()); ExpressionConverter converter = new ExpressionConverter(); - Collection collectionColumns = segment.getCommonTableExpressions().iterator().next().getColumns(); + Collection collectionColumns = withSegment.getCommonTableExpressions().iterator().next().getColumns(); Collection convertedColumns; SqlNodeList columns = null; if (!collectionColumns.isEmpty()) {