Merge SequenceQuery and ArrayQuery