Skip to content

Commit 9c50e44

Browse files
committed
维表join npe问题
1 parent df2d178 commit 9c50e44

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/src/main/java/com/dtstack/flink/sql/side/SideSqlExec.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,14 @@ private SqlNode replaceOrderByTableName(SqlNode orderNode, String tableAlias) {
360360
private SqlNode replaceNodeInfo(SqlNode groupNode, HashBasedTable<String, String, String> mappingTable, String tableAlias){
361361
if(groupNode.getKind() == IDENTIFIER){
362362
SqlIdentifier sqlIdentifier = (SqlIdentifier) groupNode;
363+
if(sqlIdentifier.names.size() == 1){
364+
return sqlIdentifier;
365+
}
363366
String mappingFieldName = mappingTable.get(sqlIdentifier.getComponent(0).getSimple(), sqlIdentifier.getComponent(1).getSimple());
364367

368+
if(mappingFieldName == null){
369+
throw new RuntimeException("can't find mapping fieldName:" + sqlIdentifier.toString() );
370+
}
365371
sqlIdentifier = sqlIdentifier.setName(0, tableAlias);
366372
return sqlIdentifier.setName(1, mappingFieldName);
367373
}else if(groupNode instanceof SqlBasicCall){

0 commit comments

Comments
 (0)