Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: zhangqiang <[email protected]>
  • Loading branch information
sevev committed Jun 13, 2024
1 parent f9945bb commit 093955b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
import com.starrocks.sql.ast.CreateIndexClause;
import com.starrocks.sql.ast.DistributionDesc;
import com.starrocks.sql.ast.DropColumnClause;
import com.starrocks.sql.ast.DropPartitionClause;
import com.starrocks.sql.ast.DropFieldClause;
import com.starrocks.sql.ast.DropPartitionClause;
import com.starrocks.sql.ast.DropRollupClause;
import com.starrocks.sql.ast.HashDistributionDesc;
import com.starrocks.sql.ast.IndexDef;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private Type getFieldType(Type type, String fieldName) {

public void analyze(Column baseCol, boolean dropField) throws AnalysisException {
if (baseCol == null) {
throw new AnalysisException(String.format("Analyze add/drop field failed, modifyc column is not exist"));
throw new AnalysisException(String.format("Analyze add/drop field failed, modify column is not exist"));
}

Type targetFieldType = baseCol.getType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4083,7 +4083,6 @@ public ParseNode visitDropColumnClause(StarRocksParser.DropColumnClauseContext c
@Override
public ParseNode visitAddFieldClause(StarRocksParser.AddFieldClauseContext context) {
String columnName = getIdentifierName(context.identifier(0));
String rollupName = null;
StarRocksParser.SubfieldDescContext subFieldDescContext = context.subfieldDesc();
List<String> parts = new ArrayList<>();
if (subFieldDescContext.nestedFieldName() != null) {
Expand All @@ -4107,7 +4106,7 @@ public ParseNode visitAddFieldClause(StarRocksParser.AddFieldClauseContext conte
throw new ParsingException("add field clause name is null");
}
StructFieldDesc fieldDesc = new StructFieldDesc(fieldName, parts, typeDef, fieldPosition);
return new AddFieldClause(columnName, fieldDesc, rollupName, getProperties(context.properties()));
return new AddFieldClause(columnName, fieldDesc, null, getProperties(context.properties()));
}

@Override
Expand Down Expand Up @@ -7418,8 +7417,8 @@ private List<String> getFieldName(StarRocksParser.NestedFieldNameContext context
for (ParseTree c : context.children) {
if (c instanceof StarRocksParser.SubfieldNameContext) {
StarRocksParser.SubfieldNameContext subfieldNameContext = (StarRocksParser.SubfieldNameContext) c;
if (subfieldNameContext.ARRAR_ELEMENT() != null) {
TerminalNode t = subfieldNameContext.ARRAR_ELEMENT();
if (subfieldNameContext.ARRAY_ELEMENT() != null) {
TerminalNode t = subfieldNameContext.ARRAY_ELEMENT();
parts.add(t.getText());
} else {
StarRocksParser.IdentifierContext identifierContext = subfieldNameContext.identifier();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ compactionClause
;

subfieldName
: identifier | '[*]'
: identifier | ARRAY_ELEMENT
;

nestedFieldName
Expand Down Expand Up @@ -2694,4 +2694,5 @@ nonReserved
| YEAR
| DOTDOTDOT | NGRAMBF
| FIELD
;
| ARRAY_ELEMENT
;
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ LTE : '<=';
GT : '>';
GTE : '>=';
EQ_FOR_NULL: '<=>';
ARRAR_ELEMENT: '[*]';
ARRAY_ELEMENT: '[*]';

PLUS_SYMBOL: '+';
MINUS_SYMBOL: '-';
Expand Down

0 comments on commit 093955b

Please sign in to comment.