Skip to content

Commit

Permalink
DRILL-2066: Clear target vectors before performing transfer()
Browse files Browse the repository at this point in the history
  • Loading branch information
mehant committed Jan 24, 2015
1 parent 4277a25 commit 5b2a11b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
Expand Up @@ -159,6 +159,7 @@ public TransferPair makeTransferPair(ValueVector to) {
}

public void transferTo(${minor.class}Vector target){
target.clear();
target.data = data;
target.data.retain();
target.data.writerIndex(data.writerIndex());
Expand Down
Expand Up @@ -100,6 +100,7 @@ public TransferPair makeTransferPair(ValueVector to) {
}

public void transferTo(Repeated${minor.class}Vector target){
target.clear();
offsets.transferTo(target.offsets);
values.transferTo(target.values);
target.parentValueCount = parentValueCount;
Expand Down
Expand Up @@ -161,6 +161,7 @@ public TransferPair makeTransferPair(ValueVector to) {
}

public void transferTo(${minor.class}Vector target){
target.clear();
this.offsetVector.transferTo(target.offsetVector);
target.data = data;
target.data.retain();
Expand Down
@@ -0,0 +1,33 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.drill.exec.physical.impl.sort;

import org.apache.drill.BaseTestQuery;
import org.junit.Test;

/**
* Placeholder for all sort related test. Can be used as we move
* more tests to use the new test framework
*/
public class TestSort extends BaseTestQuery {

@Test
public void testSortWithComplexInput() throws Exception {
test("select t.a from cp.`jsoninput/repeatedmap_sort_bug.json` t order by t.b");
}
}
@@ -0,0 +1 @@
{"a" : [ {"c": 1} ], "b" : 2.1}

0 comments on commit 5b2a11b

Please sign in to comment.