Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public class CopyFromDesc {

public CopyFromDesc(StageAndPattern stageAndPattern) {
this.stageAndPattern = stageAndPattern;
this.fileFilterExpr = Optional.empty();
}

public CopyFromDesc(StageAndPattern stageAndPattern, List<NamedExpression> exprList,
Expand Down Expand Up @@ -105,7 +106,7 @@ public List<String> getTargetColumns() {
*/
public void validate(String fullDbName, TableName tableName, boolean useDeleteSign, String fileType)
throws AnalysisException {
if (exprList == null && fileFilterExpr == null && !useDeleteSign) {
if (exprList == null && !fileFilterExpr.isPresent() && !useDeleteSign) {
return;
}
this.fileColumns = new ArrayList<>();
Expand Down Expand Up @@ -240,7 +241,7 @@ private int getMaxFileColumnId() throws AnalysisException {
exprList.stream().map(expr -> (Expression) expr).collect(Collectors.toList()));
maxId = maxId > maxFileColumnId ? maxId : maxFileColumnId;
}
if (fileFilterExpr != null) {
if (fileFilterExpr.isPresent()) {
int maxFileColumnId = getMaxFileFilterColumnId(Lists.newArrayList(fileFilterExpr.get()));
maxId = maxId > maxFileColumnId ? maxId : maxFileColumnId;
}
Expand Down
Loading