Skip to content

Commit

Permalink
WithSegment supported
Browse files Browse the repository at this point in the history
  • Loading branch information
kanha-gupta committed Sep 25, 2023
1 parent 6f963c8 commit 7dd47d5
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@
* With converter.
*/
public final class WithConverter {

/**
* Convert.
*
* @param withSegment with segment
* @param query SqlNode
* @return SqlNodeList
*/
public Optional<SqlNodeList> 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<SqlNodeList> 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<ColumnSegment> collectionColumns = segment.getCommonTableExpressions().iterator().next().getColumns();
Collection<ColumnSegment> collectionColumns = withSegment.getCommonTableExpressions().iterator().next().getColumns();
Collection<SqlNode> convertedColumns;
SqlNodeList columns = null;
if (!collectionColumns.isEmpty()) {
Expand Down

0 comments on commit 7dd47d5

Please sign in to comment.