Skip to content

Commit

Permalink
feat spelling mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
tyat authored and wenshao committed Aug 7, 2023
1 parent bf4e78e commit 4847886
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,30 +59,30 @@ public OscarSelectParser createSQLSelectParser() {
public SQLUpdateStatement parseUpdateStatement() {
accept(Token.UPDATE);

OscarUpdateStatement udpateStatement = new OscarUpdateStatement();
OscarUpdateStatement updateStatement = new OscarUpdateStatement();

SQLSelectParser selectParser = this.exprParser.createSelectParser();
SQLTableSource tableSource = selectParser.parseTableSource();
udpateStatement.setTableSource(tableSource);
updateStatement.setTableSource(tableSource);

parseUpdateSet(udpateStatement);
parseUpdateSet(updateStatement);

if (lexer.token() == Token.FROM) {
lexer.nextToken();
SQLTableSource from = selectParser.parseTableSource();
udpateStatement.setFrom(from);
updateStatement.setFrom(from);
}

if (lexer.token() == (Token.WHERE)) {
lexer.nextToken();
udpateStatement.setWhere(this.exprParser.expr());
updateStatement.setWhere(this.exprParser.expr());
}

if (lexer.token() == Token.RETURNING) {
lexer.nextToken();

for (;;) {
udpateStatement.getReturning().add(this.exprParser.expr());
updateStatement.getReturning().add(this.exprParser.expr());
if (lexer.token() == Token.COMMA) {
lexer.nextToken();
continue;
Expand All @@ -91,7 +91,7 @@ public SQLUpdateStatement parseUpdateStatement() {
}
}

return udpateStatement;
return updateStatement;
}

public OscarInsertStatement parseInsert() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,30 +55,30 @@ public PGSelectParser createSQLSelectParser() {
public SQLUpdateStatement parseUpdateStatement() {
accept(Token.UPDATE);

PGUpdateStatement udpateStatement = new PGUpdateStatement();
PGUpdateStatement updateStatement = new PGUpdateStatement();

SQLSelectParser selectParser = this.exprParser.createSelectParser();
SQLTableSource tableSource = selectParser.parseTableSource();
udpateStatement.setTableSource(tableSource);
updateStatement.setTableSource(tableSource);

parseUpdateSet(udpateStatement);
parseUpdateSet(updateStatement);

if (lexer.token() == Token.FROM) {
lexer.nextToken();
SQLTableSource from = selectParser.parseTableSource();
udpateStatement.setFrom(from);
updateStatement.setFrom(from);
}

if (lexer.token() == (Token.WHERE)) {
lexer.nextToken();
udpateStatement.setWhere(this.exprParser.expr());
updateStatement.setWhere(this.exprParser.expr());
}

if (lexer.token() == Token.RETURNING) {
lexer.nextToken();

for (; ; ) {
udpateStatement.getReturning().add(this.exprParser.expr());
updateStatement.getReturning().add(this.exprParser.expr());
if (lexer.token() == Token.COMMA) {
lexer.nextToken();
continue;
Expand All @@ -87,7 +87,7 @@ public SQLUpdateStatement parseUpdateStatement() {
}
}

return udpateStatement;
return updateStatement;
}

public PGInsertStatement parseInsert() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,37 +314,37 @@ protected SQLServerUpdateStatement createUpdateStatement() {
}

public SQLUpdateStatement parseUpdateStatement() {
SQLServerUpdateStatement udpateStatement = createUpdateStatement();
SQLServerUpdateStatement updateStatement = createUpdateStatement();

accept(Token.UPDATE);

SQLServerTop top = this.getExprParser().parseTop();
if (top != null) {
udpateStatement.setTop(top);
updateStatement.setTop(top);
}

SQLTableSource tableSource = this.exprParser.createSelectParser().parseTableSource();
udpateStatement.setTableSource(tableSource);
updateStatement.setTableSource(tableSource);

parseUpdateSet(udpateStatement);
parseUpdateSet(updateStatement);

SQLServerOutput output = this.getExprParser().parserOutput();
if (output != null) {
udpateStatement.setOutput(output);
updateStatement.setOutput(output);
}

if (lexer.token() == Token.FROM) {
lexer.nextToken();
SQLTableSource from = this.exprParser.createSelectParser().parseTableSource();
udpateStatement.setFrom(from);
updateStatement.setFrom(from);
}

if (lexer.token() == (Token.WHERE)) {
lexer.nextToken();
udpateStatement.setWhere(this.exprParser.expr());
updateStatement.setWhere(this.exprParser.expr());
}

return udpateStatement;
return updateStatement;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4440,29 +4440,29 @@ public SQLSelectParser createSQLSelectParser(SQLExprParser exprParser) {
}

public SQLUpdateStatement parseUpdateStatement() {
SQLUpdateStatement udpateStatement = createUpdateStatement();
SQLUpdateStatement updateStatement = createUpdateStatement();

if (lexer.token == Token.UPDATE) {
lexer.nextToken();

SQLTableSource tableSource = this.exprParser.createSelectParser().parseTableSource();
udpateStatement.setTableSource(tableSource);
updateStatement.setTableSource(tableSource);
}

if (dbType == DbType.odps && lexer.token == PARTITION) {
lexer.nextToken();
udpateStatement.setPartitions(new ArrayList<>());
this.exprParser.parseAssignItem(udpateStatement.getPartitions(), udpateStatement);
updateStatement.setPartitions(new ArrayList<>());
this.exprParser.parseAssignItem(updateStatement.getPartitions(), updateStatement);
}

parseUpdateSet(udpateStatement);
parseUpdateSet(updateStatement);

if (lexer.token == (Token.WHERE)) {
lexer.nextToken();
udpateStatement.setWhere(this.exprParser.expr());
updateStatement.setWhere(this.exprParser.expr());
}

return udpateStatement;
return updateStatement;
}

protected void parseUpdateSet(SQLUpdateStatement update) {
Expand Down

0 comments on commit 4847886

Please sign in to comment.