Norris Lee created DRILL-1199:
---------------------------------

             Summary: Order by nested inside a where clause fails
                 Key: DRILL-1199
                 URL: https://issues.apache.org/jira/browse/DRILL-1199
             Project: Apache Drill
          Issue Type: Bug
            Reporter: Norris Lee


Tableau wraps all Custom SQL queries in a SELECT * FROM ( <query> ) 
`TableauSQL` WHERE (0=1)
If the query contains an order by, the query will fail
{code}
0: jdbc:drill:zk=localhost:5181> select * from (select cast(c_time as time) 
c_time from `dfs`.`default`.`opt/drill/raw-files/data` order by c_time) 
`TableauSQL` where (0=1);
Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while 
running query.[error_id: "250c3758-7254-43d5-b354-ca77f5765876"
endpoint {
  address: "192.168.39.43"
  user_port: 31010
  control_port: 31011
  data_port: 31012
}
error_type: 0
message: "Screen received stop request sent. < SchemaChangeException:[ Failure 
while attempting to load generated class ] < ClassTransformationException:[ 
Failure generating transformation classes for value: 
 
package org.apache.drill.exec.test.generated;

import org.apache.drill.exec.exception.SchemaChangeException;
import org.apache.drill.exec.ops.FragmentContext;
import org.apache.drill.exec.record.RecordBatch;
import org.apache.drill.exec.vector.NullableTimeVector;

public class CopierGen167 {

    NullableTimeVector vv0;
    NullableTimeVector vv3;

    public boolean doEval(int inIndex, int outIndex)
        throws SchemaChangeException
    {
        {
            if (!vv3 .copyFromSafe(((inIndex)& 65535), (outIndex), vv0 
[((inIndex)>>> 16)])) {
                return false;
            }
        }
        {
            return true;
        }
    }

    public void doSetup(FragmentContext context, RecordBatch incoming, 
RecordBatch outgoing)
        throws SchemaChangeException
    {
        {
            int[] fieldIds1 = new int[ 1 ] ;
            fieldIds1 [ 0 ] = 0;
            Object tmp2 = 
(incoming).getValueAccessorById(NullableTimeVector.class, 
fieldIds1).getValueVector();
            if (tmp2 == null) {
                throw new SchemaChangeException("Failure while loading vector 
vv0 with id: org.apache.drill.exec.record.TypedFieldId@6c3316c7.");
            }
            vv0 = ((NullableTimeVector) tmp2);
            int[] fieldIds4 = new int[ 1 ] ;
            fieldIds4 [ 0 ] = 0;
            Object tmp5 = 
(outgoing).getValueAccessorById(NullableTimeVector.class, 
fieldIds4).getValueVector();
            if (tmp5 == null) {
                throw new SchemaChangeException("Failure while loading vector 
vv3 with id: org.apache.drill.exec.record.TypedFieldId@6c3316c7.");
            }
            vv3 = ((NullableTimeVector) tmp5);
        }
    }

}
 ] < CompileException:[ Line 18, Column 36: No applicable constructor/method 
found for actual parameters "int, int, java.lang.Object"; candidates are: 
"public boolean 
org.apache.drill.exec.vector.NullableTimeVector.copyFromSafe(int, int, 
org.apache.drill.exec.vector.TimeVector)", "public boolean 
org.apache.drill.exec.vector.NullableTimeVector.copyFromSafe(int, int, 
org.apache.drill.exec.vector.NullableTimeVector)" ]"
]
Error: exception while executing query (state=,code=0)
{code}

The query runs fine without the order by clause.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to