Source:
<code>private QueryPlan getQueryPlan(final JobContext context, final Configuration configuration) throws IOException { Preconditions.checkNotNull(context); try { final String txnScnValue = configuration.get(PhoenixConfigurationUtil.TX_SCN_VALUE); final String currentScnValue = configuration.get(PhoenixConfigurationUtil.CURRENT_SCN_VALUE); final String snapshotName = configuration.get(PhoenixConfigurationUtil.SNAPSHOT_NAME_KEY); final Properties overridingProps = new Properties(); if(txnScnValue==null && currentScnValue!=null) { overridingProps.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, currentScnValue); } final Connection connection = ConnectionUtil.getInputConnection(configuration, overridingProps); final String selectStatement = PhoenixConfigurationUtil.getSelectStatement(configuration); Preconditions.checkNotNull(selectStatement); final Statement statement = connection.createStatement(); final PhoenixStatement pstmt = statement.unwrap(PhoenixStatement.class); final QueryPlan queryPlan = pstmt.optimizeQuery(selectStatement); final Scan scan = queryPlan.getContext().getScan(); if (txnScnValue!=null) { scan.setAttribute(BaseScannerRegionObserver.TX_SCN, Bytes.toBytes(Long.valueOf(txnScnValue))); } <START> if(snapshotName != null) <END> queryPlan.iterator(SnapshotMRParallelScanGrouper.init(configuration)); else queryPlan.iterator(TableMRParallelScanGrouper.getInstance()); return queryPlan; } catch (Exception exception) { LOG.error(String.format("Failed to get the query plan with error [%s]", exception.getMessage())); throw new RuntimeException(exception); } }</code><technical_language>Add init method ParallelScanGrouper interface returns instance TableMRParallelScanGrouper implementation of return TableMRParallelScanGrouper.getInstance(). need switching logic based snapshotName</technical_language>

Target:
private QueryPlan getQueryPlan(final JobContext context, final Configuration configuration) throws IOException { Preconditions.checkNotNull(context); try { final String txnScnValue = configuration.get(PhoenixConfigurationUtil.TX_SCN_VALUE); final String currentScnValue = configuration.get(PhoenixConfigurationUtil.CURRENT_SCN_VALUE); final Properties overridingProps = new Properties(); if(txnScnValue==null && currentScnValue!=null) { overridingProps.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, currentScnValue); } final Connection connection = ConnectionUtil.getInputConnection(configuration, overridingProps); final String selectStatement = PhoenixConfigurationUtil.getSelectStatement(configuration); Preconditions.checkNotNull(selectStatement); final Statement statement = connection.createStatement(); final PhoenixStatement pstmt = statement.unwrap(PhoenixStatement.class); final QueryPlan queryPlan = pstmt.optimizeQuery(selectStatement); final Scan scan = queryPlan.getContext().getScan(); if (txnScnValue!=null) { scan.setAttribute(BaseScannerRegionObserver.TX_SCN, Bytes.toBytes(Long.valueOf(txnScnValue))); } queryPlan.iterator(MapReduceParallelScanGrouper.getInstance()); return queryPlan; } catch (Exception exception) { LOG.error(String.format("Failed to get the query plan with error [%s]", exception.getMessage())); throw new RuntimeException(exception); } }