-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bigquery sql parser support create model
- Loading branch information
Showing
6 changed files
with
241 additions
and
9 deletions.
There are no files selected for viewing
90 changes: 90 additions & 0 deletions
90
...rc/main/java/com/alibaba/druid/sql/dialect/bigquery/ast/BigQueryCreateModelStatement.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,90 @@ | ||
package com.alibaba.druid.sql.dialect.bigquery.ast; | ||
|
||
import com.alibaba.druid.sql.ast.SQLName; | ||
import com.alibaba.druid.sql.ast.SQLStatement; | ||
import com.alibaba.druid.sql.ast.SQLStatementImpl; | ||
import com.alibaba.druid.sql.ast.statement.SQLAssignItem; | ||
import com.alibaba.druid.sql.dialect.bigquery.visitor.BigQueryVisitor; | ||
import com.alibaba.druid.sql.visitor.SQLASTVisitor; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class BigQueryCreateModelStatement extends SQLStatementImpl implements BigQueryObject { | ||
private boolean ifNotExists; | ||
private boolean replace; | ||
|
||
private SQLName name; | ||
private final List<SQLAssignItem> options = new ArrayList<>(); | ||
private SQLStatement trainingData; | ||
private SQLStatement customHoliday; | ||
|
||
public SQLName getName() { | ||
return name; | ||
} | ||
|
||
public void setName(SQLName x) { | ||
if (x != null) { | ||
x.setParent(this); | ||
} | ||
this.name = x; | ||
} | ||
|
||
public List<SQLAssignItem> getOptions() { | ||
return options; | ||
} | ||
|
||
public boolean isIfNotExists() { | ||
return ifNotExists; | ||
} | ||
|
||
public void setIfNotExists(boolean ifNotExists) { | ||
this.ifNotExists = ifNotExists; | ||
} | ||
|
||
public boolean isReplace() { | ||
return replace; | ||
} | ||
|
||
public void setReplace(boolean replace) { | ||
this.replace = replace; | ||
} | ||
|
||
public SQLStatement getTrainingData() { | ||
return trainingData; | ||
} | ||
|
||
public void setTrainingData(SQLStatement x) { | ||
if (x != null) { | ||
x.setParent(this); | ||
} | ||
this.trainingData = x; | ||
} | ||
|
||
public SQLStatement getCustomHoliday() { | ||
return customHoliday; | ||
} | ||
|
||
public void setCustomHoliday(SQLStatement x) { | ||
if (x != null) { | ||
x.setParent(this); | ||
} | ||
this.customHoliday = x; | ||
} | ||
|
||
@Override | ||
public void accept0(SQLASTVisitor v) { | ||
if (v instanceof BigQueryVisitor) { | ||
accept0((BigQueryVisitor) v); | ||
} else { | ||
super.accept0(v); | ||
} | ||
} | ||
|
||
@Override | ||
public void accept0(BigQueryVisitor visitor) { | ||
if (visitor.visit(this)) { | ||
acceptChild(visitor, name); | ||
} | ||
} | ||
} |
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
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
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
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
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