improved hive sql parser support.

This commit is contained in:
wenshao
2017-11-30 17:05:19 +08:00
parent a7e7046ed8
commit ade87e4b8e
16 changed files with 105 additions and 118 deletions
@@ -6025,4 +6025,20 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
}
return false;
}
public boolean visit(SQLExternalRecordFormat x) {
if (x.getDelimitedBy() != null) {
println();
print0(ucase ? "RECORDS DELIMITED BY " : "records delimited by ");
x.getDelimitedBy().accept(this);
}
if (x.getTerminatedBy() != null) {
println();
print0(ucase ? "FIELDS TERMINATED BY " : "fields terminated by ");
x.getTerminatedBy().accept(this);
}
return false;
}
}
@@ -799,4 +799,7 @@ public interface SQLASTVisitor {
boolean visit(SQLDropTypeStatement x);
void endVisit(SQLDropTypeStatement x);
boolean visit(SQLExternalRecordFormat x);
void endVisit(SQLExternalRecordFormat x);
}
@@ -1866,6 +1866,14 @@ public class SQLASTVisitorAdapter implements SQLASTVisitor {
}
public boolean visit(SQLExternalRecordFormat x) {
return true;
}
public void endVisit(SQLExternalRecordFormat x) {
}
public final boolean isEnabled(VisitorFeature feature) {
return VisitorFeature.isEnabled(this.features, feature);
}
@@ -2416,4 +2416,9 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
public boolean visit(SQLDropTypeStatement x) {
return false;
}
@Override
public boolean visit(SQLExternalRecordFormat x) {
return false;
}
}