@@ -3048,6 +3048,7 @@ private RelNode genTableLogicalPlan(String tableAlias, QB qb) throws SemanticExc
30483048 final NotNullConstraint nnc = tabMetaData .getNotNullConstraint ();
30493049 final PrimaryKeyInfo pkc = tabMetaData .getPrimaryKeyInfo ();
30503050
3051+ Set <String > alreadyAdded = new HashSet <>();
30513052 for (StructField structField : fields ) {
30523053 colName = structField .getFieldName ();
30533054 colInfo = new ColumnInfo (
@@ -3056,6 +3057,7 @@ private RelNode genTableLogicalPlan(String tableAlias, QB qb) throws SemanticExc
30563057 isNullable (colName , nnc , pkc ), tableAlias , false );
30573058 colInfo .setSkewedCol (isSkewedCol (tableAlias , qb , colName ));
30583059 rr .put (tableAlias , colName , colInfo );
3060+ alreadyAdded .add (colName );
30593061 cInfoLst .add (colInfo );
30603062 }
30613063 // TODO: Fix this
@@ -3065,6 +3067,9 @@ private RelNode genTableLogicalPlan(String tableAlias, QB qb) throws SemanticExc
30653067 // 3.2 Add column info corresponding to partition columns
30663068 for (FieldSchema part_col : tabMetaData .getPartCols ()) {
30673069 colName = part_col .getName ();
3070+ if (alreadyAdded .contains (colName )) {
3071+ continue ;
3072+ }
30683073 colInfo = new ColumnInfo (colName ,
30693074 TypeInfoFactory .getPrimitiveTypeInfo (part_col .getType ()),
30703075 isNullable (colName , nnc , pkc ), tableAlias , true );
0 commit comments