Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions src/main/java/net/sf/jsqlparser/expression/CastExpression.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,13 @@ public class CastExpression extends ASTNodeAccessImpl implements Expression {
// https://cloud.google.com/bigquery/docs/reference/standard-sql/conversion_functions#cast_as_date
private String format = null;

public CastExpression(String keyword, Expression leftExpression, String dataType) {
public CastExpression(String keyword, Expression leftExpression, ColDataType colDataType) {
this.keyword = keyword;
this.leftExpression = leftExpression;
this.colDataType = new ColDataType(dataType);
this.colDataType = colDataType;
}

// Implicit Cast
public CastExpression(String dataType, String value) {
this.keyword = null;
this.isImplicitCast = true;
this.colDataType = new ColDataType(dataType);
this.leftExpression = new StringValue(value);
}

public CastExpression(ColDataType colDataType, String value) {
this.keyword = null;
this.isImplicitCast = true;
Expand All @@ -71,10 +64,10 @@ public CastExpression(ColDataType colDataType, Double value) {
this.leftExpression = new DoubleValue(value);
}

public CastExpression(Expression leftExpression, String dataType) {
public CastExpression(Expression leftExpression, ColDataType colDataType) {
this.keyword = null;
this.leftExpression = leftExpression;
this.colDataType = new ColDataType(dataType);
this.colDataType = colDataType;
}


Expand Down
Loading
Loading