Source:
public List<List<Object>> execute() { List<Tuple2<Integer, PrestoSparkRow>> rddResults; try { rddResults = doExecute(plan); commit(session, transactionManager); } catch (RuntimeException executionFailure) { try { rollback(session, transactionManager); } catch (RuntimeException rollbackFailure) { if (executionFailure != rollbackFailure) { executionFailure.addSuppressed(rollbackFailure); } } try { queryCompletedEvent(Optional.of(executionFailure)); } catch (RuntimeException eventFailure) { if (executionFailure != eventFailure) { executionFailure.addSuppressed(eventFailure); } } throw executionFailure; } queryCompletedEvent(Optional.empty()); ConnectorSession connectorSession = session.toConnectorSession(); List<Type> types = plan.getFragment().getTypes(); ImmutableList.Builder<List<Object>> result = ImmutableList.builder(); for (Tuple2<Integer, PrestoSparkRow> tuple : rddResults) { PrestoSparkRow row = tuple._2; SliceInput sliceInput = new BasicSliceInput(Slices.wrappedBuffer(row.getBytes(), 0, row.getLength())); ImmutableList.Builder<Object> columns = ImmutableList.builder(); for (Type type : types) { BlockBuilder blockBuilder = type.createBlockBuilder(null, 1); blockBuilder.readPositionFrom(sliceInput); columns.add(type.getObjectValue(connectorSession.getSqlFunctionProperties(), blockBuilder, 0)); } result.add(columns.build()); } return result.build(); }

Target:
public List<List<Object>> execute() { List<Tuple2<Integer, PrestoSparkRow>> rddResults; try { rddResults = doExecute(plan); commit(session, transactionManager); } catch (Exception executionFailure) { try { rollback(session, transactionManager); } catch (RuntimeException rollbackFailure) { log.error(rollbackFailure, "Encountered error when performing rollback"); } try { queryCompletedEvent(Optional.of(executionFailure)); } catch (RuntimeException eventFailure) { log.error(eventFailure, "Error publishing query completed event"); } if (executionFailure instanceof SparkException) { Optional<ExecutionFailureInfo> executionFailureInfo = executionExceptionFactory.tryDecode((SparkException) executionFailure); if (executionFailureInfo.isPresent()) { throw executionFailureInfo.get().toFailure(); } throw executionFailure; } if (executionFailure instanceof PrestoSparkExecutionException) { Optional<ExecutionFailureInfo> executionFailureInfo = executionExceptionFactory.tryDecode((PrestoSparkExecutionException) executionFailure); verify(executionFailureInfo.isPresent()); throw executionFailureInfo.get().toFailure(); } throw executionFailure; } queryCompletedEvent(Optional.empty()); ConnectorSession connectorSession = session.toConnectorSession(); List<Type> types = plan.getFragment().getTypes(); ImmutableList.Builder<List<Object>> result = ImmutableList.builder(); for (Tuple2<Integer, PrestoSparkRow> tuple : rddResults) { PrestoSparkRow row = tuple._2; SliceInput sliceInput = new BasicSliceInput(Slices.wrappedBuffer(row.getBytes(), 0, row.getLength())); List<Object> columns = new ArrayList<>(); for (Type type : types) { BlockBuilder blockBuilder = type.createBlockBuilder(null, 1); blockBuilder.readPositionFrom(sliceInput); columns.add(type.getObjectValue(connectorSession.getSqlFunctionProperties(), blockBuilder, 0)); } result.add(unmodifiableList(columns)); } return result.build(); }