-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
35,447 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
boot-base/boot-basic-io/src/main/java/com/iyang/bootbasicio/sql/IcebergVisitor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.iyang.bootbasicio.sql; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.antlr.v4.runtime.tree.ParseTree; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/*** | ||
* @author: yang_bao | ||
* @date: 2023/10/30 | ||
* @desc: | ||
***/ | ||
|
||
@Slf4j | ||
public class IcebergVisitor extends SqlBaseBaseVisitor { | ||
|
||
|
||
private List<String> tableList = new ArrayList<>(); | ||
|
||
@Override | ||
public List<String> visitSingleStatement(SqlBaseParser.SingleStatementContext ctx) { | ||
super.visitSingleStatement(ctx); | ||
|
||
|
||
return tableList; | ||
} | ||
|
||
|
||
@Override | ||
public List<String> visitTableIdentifier(SqlBaseParser.TableIdentifierContext ctx) { | ||
String db = ctx.db.getText(); | ||
String table = ctx.table.getText(); | ||
|
||
System.out.println("1111"); | ||
log.info("the visitTableIdentifier db value is --> {} , table is ---> {} " , db, table); | ||
return tableList; | ||
} | ||
|
||
|
||
@Override | ||
public Object visitInsertOverwriteTable(SqlBaseParser.InsertOverwriteTableContext ctx) { | ||
|
||
return super.visitInsertOverwriteTable(ctx); | ||
} | ||
|
||
/* @Override | ||
public Object visitSingleInsertQuery(SqlBaseParser.SingleInsertQueryContext ctx) { | ||
String queryTermText = ctx.queryTerm().getText(); | ||
String queryStart = ctx.queryTerm().getStart().getText(); | ||
String queryStop = ctx.queryTerm().getStop().getText(); | ||
SqlBaseParser.QueryTermContext termContext = ctx.queryTerm(); | ||
log.info("the visitSingleInsertQuery.queryTerm() --> {}, start ---> {} , stop ---> {} ", queryTermText, queryStart, queryStop); | ||
return super.visitSingleInsertQuery(ctx); | ||
}*/ | ||
|
||
@Override | ||
public Object visitUpdateTable(SqlBaseParser.UpdateTableContext ctx) { | ||
|
||
|
||
return super.visitUpdateTable(ctx); | ||
} | ||
|
||
|
||
@Override | ||
public Object visitDeleteFromTable(SqlBaseParser.DeleteFromTableContext ctx) { | ||
return super.visitDeleteFromTable(ctx); | ||
} | ||
} |
Oops, something went wrong.