presto-connector/src/main/java/com/facebook/presto/maxcompute/MaxComputeInputSplit.java [26:103]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class MaxComputeInputSplit
{
    private String sessionId;
    private Integer splitIndex;
    private Long startIndex;
    private Long numRecord;

    @JsonCreator
    public MaxComputeInputSplit(
            @JsonProperty("sessionId") String sessionId, 
            @JsonProperty("splitIndex") Integer splitIndex,
            @JsonProperty("startIndex") Long startIndex, @JsonProperty("numRecord") Long numRecord)
    {
        this.sessionId = requireNonNull(sessionId, "schema name is null");
        this.splitIndex = requireNonNull(splitIndex, "connector id is null");
        this.startIndex = requireNonNull(startIndex, "table name is null");
        this.numRecord = requireNonNull(numRecord, "inputSplit is null");
    }

    public MaxComputeInputSplit(InputSplit inputSplit)
    {
        sessionId = requireNonNull(inputSplit, "input split is null").getSessionId();
        if (inputSplit instanceof IndexedInputSplit) {
            splitIndex = ((IndexedInputSplit) inputSplit).getSplitIndex();
            startIndex = -1L;
            numRecord = -1L;
        }
        else if (inputSplit instanceof RowRangeInputSplit) {
            startIndex = ((RowRangeInputSplit) inputSplit).getRowRange().getStartIndex();
            numRecord = ((RowRangeInputSplit) inputSplit).getRowRange().getNumRecord();
            splitIndex = -1;
        }
    }

    public InputSplit toInputSplit()
    {
        if (splitIndex != null && splitIndex >= 0) {
            return new IndexedInputSplit(sessionId, splitIndex);
        }
        else if (startIndex != null && numRecord != null) {
            return new RowRangeInputSplit(sessionId, startIndex, numRecord);
        }
        else {
            throw new IllegalArgumentException("invalid input split");
        }
    }

    @JsonProperty
    public String getSessionId()
    {
        return sessionId;
    }

    @JsonProperty
    public Integer getSplitIndex()
    {
        return splitIndex;
    }

    @JsonProperty
    public Long getStartIndex()
    {
        return startIndex;
    }

    @JsonProperty
    public Long getNumRecord()
    {
        return numRecord;
    }

    @Override
    public String toString()
    {
        return toStringHelper(this)
                .add("sessionId", sessionId)
                .add("splitIndex", splitIndex)
                .toString();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



trino-connector/src/main/java/io/trino/plugin/maxcompute/MaxComputeInputSplit.java [26:103]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class MaxComputeInputSplit
{
    private String sessionId;
    private Integer splitIndex;
    private Long startIndex;
    private Long numRecord;

    @JsonCreator
    public MaxComputeInputSplit(
            @JsonProperty("sessionId") String sessionId,
            @JsonProperty("splitIndex") Integer splitIndex,
            @JsonProperty("startIndex") Long startIndex, @JsonProperty("numRecord") Long numRecord)
    {
        this.sessionId = requireNonNull(sessionId, "schema name is null");
        this.splitIndex = requireNonNull(splitIndex, "connector id is null");
        this.startIndex = requireNonNull(startIndex, "table name is null");
        this.numRecord = requireNonNull(numRecord, "inputSplit is null");
    }

    public MaxComputeInputSplit(InputSplit inputSplit)
    {
        sessionId = requireNonNull(inputSplit, "input split is null").getSessionId();
        if (inputSplit instanceof IndexedInputSplit) {
            splitIndex = ((IndexedInputSplit) inputSplit).getSplitIndex();
            startIndex = -1L;
            numRecord = -1L;
        }
        else if (inputSplit instanceof RowRangeInputSplit) {
            startIndex = ((RowRangeInputSplit) inputSplit).getRowRange().getStartIndex();
            numRecord = ((RowRangeInputSplit) inputSplit).getRowRange().getNumRecord();
            splitIndex = -1;
        }
    }

    public InputSplit toInputSplit()
    {
        if (splitIndex != null && splitIndex >= 0) {
            return new IndexedInputSplit(sessionId, splitIndex);
        }
        else if (startIndex != null && numRecord != null) {
            return new RowRangeInputSplit(sessionId, startIndex, numRecord);
        }
        else {
            throw new IllegalArgumentException("invalid input split");
        }
    }

    @JsonProperty
    public String getSessionId()
    {
        return sessionId;
    }

    @JsonProperty
    public Integer getSplitIndex()
    {
        return splitIndex;
    }

    @JsonProperty
    public Long getStartIndex()
    {
        return startIndex;
    }

    @JsonProperty
    public Long getNumRecord()
    {
        return numRecord;
    }

    @Override
    public String toString()
    {
        return toStringHelper(this)
                .add("sessionId", sessionId)
                .add("splitIndex", splitIndex)
                .toString();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



