[ 
https://issues.apache.org/jira/browse/DRILL-3854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15020257#comment-15020257
 ] 

ASF GitHub Bot commented on DRILL-3854:
---------------------------------------

Github user hsuanyi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/262#discussion_r45541993
  
    --- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/memory/TestAllocators.java 
---
    @@ -63,6 +69,53 @@
       private final static String planFile="/physical_allocator_test.json";
     
       @Test
    +  public void testDrillBufReadIndex() throws Exception {
    +    final int length = 10;
    +
    +    final Properties props = new Properties() {
    +      {
    +        put(TopLevelAllocator.TOP_LEVEL_MAX_ALLOC, "1000000");
    +        put(TopLevelAllocator.ERROR_ON_MEMORY_LEAK, "true");
    +      }
    +    };
    +    final DrillConfig config = DrillConfig.create(props);
    +
    +    final BufferAllocator allc = RootAllocatorFactory.newRoot(config);
    +    final TypeProtos.MajorType.Builder builder = 
TypeProtos.MajorType.newBuilder();
    +    builder.setMinorType(TypeProtos.MinorType.INT);
    +    builder.setMode(TypeProtos.DataMode.REQUIRED);
    +
    +    final IntVector iv = new IntVector(MaterializedField.create("Field", 
builder.build()), allc);
    +    iv.allocateNew();
    +
    +    // Write data to DrillBuf
    +    for(int i = 0; i < length; ++i) {
    +      iv.getBuffer().writeInt(i);
    +    }
    +
    +    // Read data to DrillBuf
    +    for(int i = 0; i < length; ++i) {
    +      assertEquals((long) i, (long) iv.getBuffer().readInt());
    +    }
    +
    +    for(DrillBuf drillBuf : iv.getBuffers(false)) {
    +      assertEquals((long) 0, drillBuf.readInt());
    +    }
    +
    +    final List<DrillBuf> toBeClean = Lists.newArrayList();
    +    for(DrillBuf drillBuf : iv.getBuffers(true)) {
    +      assertEquals((long) 0, drillBuf.readInt());
    --- End diff --
    
    Just cleaned it.


> IOB Exception : CONVERT_FROM (sal, int_be)
> ------------------------------------------
>
>                 Key: DRILL-3854
>                 URL: https://issues.apache.org/jira/browse/DRILL-3854
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Flow
>    Affects Versions: 1.2.0
>         Environment: 4 node cluster CentOS
>            Reporter: Khurram Faraaz
>            Assignee: Sean Hsuan-Yi Chu
>            Priority: Critical
>             Fix For: 1.4.0
>
>         Attachments: log, run_time_code.txt
>
>
> CONVERT_FROM function results in IOB Exception
> Drill master commit id : b9afcf8f
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select salary from Emp;
> +---------+
> | salary  |
> +---------+
> | 80000   |
> | 90000   |
> | 200000  |
> | 95000   |
> | 85000   |
> | 90000   |
> | 100000  |
> | 87000   |
> | 80000   |
> | 100000  |
> | 99000   |
> +---------+
> 11 rows selected (0.535 seconds)
> # create table using above Emp table
> create table tbl_int_be as select convert_to(salary, 'int_be') sal from Emp;
> 0: jdbc:drill:schema=dfs.tmp> alter session set `planner.slice_target`=1;
> +-------+--------------------------------+
> |  ok   |            summary             |
> +-------+--------------------------------+
> | true  | planner.slice_target updated.  |
> +-------+--------------------------------+
> 1 row selected (0.19 seconds)
> # Below query results in IOB on server.
> 0: jdbc:drill:schema=dfs.tmp> select convert_from(sal, 'int_be') from 
> tbl_int_be order by sal;
> Error: SYSTEM ERROR: IndexOutOfBoundsException: DrillBuf(ridx: 0, widx: 158, 
> cap: 158/158, unwrapped: SlicedByteBuf(ridx: 0, widx: 158, cap: 158/158, 
> unwrapped: UnsafeDirectLittleEndian(PooledUnsafeDirectByteBuf(ridx: 0, widx: 
> 0, cap: 417/417)))).slice(158, 44)
> Fragment 2:0
> [Error Id: 4ee1361d-9877-45eb-bde6-57d5add9fe5e on centos-04.qa.lab:31010] 
> (state=,code=0)
> # Apply convert_from function and project original column results in IOB on 
> client. (because Error Id is missing)
> 0: jdbc:drill:schema=dfs.tmp> select convert_from(sal, 'int_be'), sal from 
> tbl_int_be;
> Error: Unexpected RuntimeException: java.lang.IndexOutOfBoundsException: 
> DrillBuf(ridx: 0, widx: 114, cap: 114/114, unwrapped: DrillBuf(ridx: 321, 
> widx: 321, cap: 321/321, unwrapped: 
> UnsafeDirectLittleEndian(PooledUnsafeDirectByteBuf(ridx: 0, widx: 0, cap: 
> 321/321)))).slice(55, 103) (state=,code=0)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to