Buggy code:
protected QueryWorkflow extendExecutionWorkflow ( String queryId , List < ExecutionPath > executionPaths , ExecutionPath mergePath , ResultType type ) { } protected ExecutionPath defineExecutionPath ( LogicalStep initial , List < ConnectorMetadata > availableConnectors ) throws PlanningException { } protected List < TableName > getInitialSteps ( List < LogicalStep > initialSteps ) { } protected LogicalWorkflow buildWorkflow ( SelectValidatedQuery query ) throws PlanningException { } protected ExecutionWorkflow buildExecutionWorkflow ( MetadataValidatedQuery query ) throws PlanningException { } private ExecutionWorkflow buildMetadataWorkflow ( MetadataValidatedQuery query ) throws PlanningException { } private ExecutionWorkflow buildManagementWorkflow ( MetadataValidatedQuery query ) throws PlanningException { } private boolean existsCatalogInCluster ( CatalogName catalogName , ClusterName clusterName ) { } protected ExecutionWorkflow buildExecutionWorkflow ( StorageValidatedQuery query ) throws PlanningException { } private Row getInsertRow ( InsertIntoStatement statement ) throws PlanningException { } private ClusterMetadata getClusterMetadata ( ClusterName clusterRef ) throws PlanningException { } private TableMetadata getTableMetadata ( TableName tableName ) throws PlanningException { } private void addProjectedColumns ( Map < String , LogicalStep > projectSteps , SelectValidatedQuery query ) { } protected Operations getFilterOperation ( final TableMetadata tableMetadata , final String statement , final Selector selector , final Operator operator ) { } private Map < String , LogicalStep > addFilter ( Map < String , LogicalStep > lastSteps , Map < String , TableMetadata > tableMetadataMap , SelectValidatedQuery query ) { } private Map < String , LogicalStep > addWindow ( Map < String , LogicalStep > lastSteps , SelectStatement stmt ) { } private Map < String , LogicalStep > addJoin ( Map < String , LogicalStep > stepMap , String targetTable , SelectValidatedQuery query ) { } protected Map < String , LogicalStep > getProjects ( SelectValidatedQuery query , Map < String , TableMetadata > tableMetadataMap ) { } protected Select generateSelect ( SelectStatement selectStatement , Map < String , TableMetadata > tableMetadataMap ) throws PlanningException { LinkedHashMap < Selector , String > aliasMap = new LinkedHashMap < > ( ) ; LinkedHashMap < String , ColumnType > typeMap = new LinkedHashMap < > ( ) ; LinkedHashMap < Selector , ColumnType > typeMapFromColumnName = new LinkedHashMap < > ( ) ; boolean addAll = false ; Operations currentOperation = Operations . SELECT_OPERATOR ; for ( Selector s : selectStatement . getSelectExpression ( ) . getSelectorList ( ) ) { if ( AsteriskSelector . class . isInstance ( s ) ) { addAll = true ; } else if ( ColumnSelector . class . isInstance ( s ) ) { ColumnSelector cs = ColumnSelector . class . cast ( s ) ; if ( ( cs . getAlias ( ) ) != null ) { aliasMap . put ( cs , cs . getAlias ( ) ) ; typeMapFromColumnName . put ( cs , tableMetadataMap . get ( cs . getSelectorTablesAsString ( ) ) . getColumns ( ) . get ( cs . getName ( ) ) . getColumnType ( ) ) ; typeMap . put ( cs . getAlias ( ) , tableMetadataMap . get ( cs . getSelectorTablesAsString ( ) ) . getColumns ( ) . get ( cs . getName ( ) ) . getColumnType ( ) ) ; } else { aliasMap . put ( cs , cs . getName ( ) . getName ( ) ) ; typeMapFromColumnName . put ( cs , tableMetadataMap . get ( cs . getSelectorTablesAsString ( ) ) . getColumns ( ) . get ( cs . getName ( ) ) . getColumnType ( ) ) ; typeMap . put ( cs . getName ( ) . getName ( ) , tableMetadataMap . get ( cs . getSelectorTablesAsString ( ) ) . getColumns ( ) . get ( cs . getName ( ) ) . getColumnType ( ) ) ; } } else if ( FunctionSelector . class . isInstance ( s ) ) { currentOperation = Operations . SELECT_FUNCTIONS ; FunctionSelector fs = FunctionSelector . class . cast ( s ) ; FunctionName functionName = new FunctionName ( fs . getFunctionName ( ) ) ; FunctionMetadata function = MANAGER . getFunctionFromManifests ( functionName ) ; <START_BUG> ColumnType ct = StringUtils . convertJavaTypeToXdType ( function . getReturningType ( ) ) ; <END_BUG> if ( ( s . getAlias ( ) ) != null ) { aliasMap . put ( fs , fs . getAlias ( ) ) ; typeMapFromColumnName . put ( fs , ct ) ; typeMap . put ( fs . getAlias ( ) , ct ) ; } else { aliasMap . put ( fs , fs . getFunctionName ( ) ) ; typeMapFromColumnName . put ( fs , ct ) ; typeMap . put ( fs . getFunctionName ( ) , ct ) ; } } else { throw new PlanningException ( ( ( s . getClass ( ) . getCanonicalName ( ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>yet." ) ) ; } } if ( addAll ) { TableMetadata metadata = tableMetadataMap . get ( selectStatement . getTableName ( ) . getQualifiedName ( ) ) ; for ( Map . Entry < ColumnName , ColumnMetadata > column : metadata . getColumns ( ) . entrySet ( ) ) { ColumnSelector cs = new ColumnSelector ( column . getKey ( ) ) ; aliasMap . put ( cs , column . getKey ( ) . getName ( ) ) ; typeMapFromColumnName . put ( cs , column . getValue ( ) . getColumnType ( ) ) ; typeMap . put ( column . getKey ( ) . getName ( ) , column . getValue ( ) . getColumnType ( ) ) ; } if ( ( selectStatement . getJoin ( ) ) != null ) { TableMetadata metadataJoin = tableMetadataMap . get ( selectStatement . getJoin ( ) . getTablename ( ) . getQualifiedName ( ) ) ; for ( Map . Entry < ColumnName , ColumnMetadata > column : metadataJoin . getColumns ( ) . entrySet ( ) ) { ColumnSelector cs = new ColumnSelector ( column . getKey ( ) ) ;

Fix:
ColumnType ct = StringUtils . convertXdTypeToColumnType ( function . getReturningType ( ) ) ;