Source:
<code>public DataSet<LocatedRow> getDataSet(DataSetProcessor dsp) throws StandardException { dsp.setSchedulerPool("admin"); try { DataSet statsDataSet; OperationContext<StatisticsOperation> operationContext = dsp.createOperationContext(this); if (scanSetBuilder.getStoredAs() != null) { ScanSetBuilder builder = scanSetBuilder; String storedAs = scanSetBuilder.getStoredAs(); if (storedAs.equals("T")) statsDataSet = dsp.readTextFile(null, builder.getLocation(), builder.getDelimited(), null, builder.getColumnPositionMap(), null, null, null, builder.getTemplate(), useSample, sampleFraction); else if (storedAs.equals("P")) statsDataSet = dsp.readParquetFile(builder.getColumnPositionMap(), builder.getPartitionByColumnMap() , builder.getLocation(), null, null, null, builder.getTemplate(), useSample, sampleFraction); else if (storedAs.equals("O")) { int[] baseColumnMap = builder.getColumnPositionMap(); for (int i = 0; i < baseColumnMap.length; i++) { <START> baseColumnMap[i] = baseColumnMap[i] - 1; END> } statsDataSet = dsp.readORCFile(baseColumnMap, builder.getPartitionByColumnMap(), builder.getLocation(), null, null, null, builder.getTemplate(), useSample, sampleFraction); } else { throw new UnsupportedOperationException("storedAs Type not supported -> " + storedAs); } } else { statsDataSet = scanSetBuilder.buildDataSet(scope); } return statsDataSet .mapPartitions( new StatisticsFlatMapFunction(operationContext, scanSetBuilder.getBaseTableConglomId(), scanSetBuilder.getColumnPositionMap(), scanSetBuilder.getTemplate())); } catch (StandardException se) { throw se; } }</code><technical_language>places in code (baseColumnMap[I] == -1) check if is a valid column id terminate a loop baseColumnMap array. Unconditionally subtracting element 1 confusion -2 in cells. change logic update "if (baseColumnMap[I] >0)"</technical_language>

Target:
public DataSet<LocatedRow> getDataSet(DataSetProcessor dsp) throws StandardException { dsp.setSchedulerPool("admin"); try { DataSet statsDataSet; OperationContext<StatisticsOperation> operationContext = dsp.createOperationContext(this); if (scanSetBuilder.getStoredAs() != null) { ScanSetBuilder builder = scanSetBuilder; String storedAs = scanSetBuilder.getStoredAs(); if (storedAs.equals("T")) statsDataSet = dsp.readTextFile(null, builder.getLocation(), builder.getDelimited(), null, builder.getColumnPositionMap(), null, null, null, builder.getTemplate(), useSample, sampleFraction); else if (storedAs.equals("P")) statsDataSet = dsp.readParquetFile(builder.getColumnPositionMap(), builder.getPartitionByColumnMap() , builder.getLocation(), null, null, null, builder.getTemplate(), useSample, sampleFraction); else if (storedAs.equals("O")) statsDataSet = dsp.readORCFile(builder.getColumnPositionMap(), builder.getPartitionByColumnMap(), builder.getLocation(), null, null, null, builder.getTemplate(), useSample, sampleFraction, true); else { throw new UnsupportedOperationException("storedAs Type not supported -> " + storedAs); } } else { statsDataSet = scanSetBuilder.buildDataSet(scope); } return statsDataSet .mapPartitions( new StatisticsFlatMapFunction(operationContext, scanSetBuilder.getBaseTableConglomId(), scanSetBuilder.getColumnPositionMap(), scanSetBuilder.getTemplate())); } catch (StandardException se) { throw se; } }