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

Jacques Nadeau commented on DRILL-215:
--------------------------------------

I assuming you mean: 

select _MAP['N_REGIONKEY'] from "sample-data/nation.parquet" order by 
_MAP['N_REGIONKEY'] desc;

which gives me: 

+---------+
| EXPR$0  |
+---------+
| 4       |
| 4       |
| 4       |
| 4       |
| 4       |
| 3       |
| 3       |
| 3       |
| 3       |
| 3       |
| 2       |
| 2       |
| 2       |
| 2       |
| 2       |
| 1       |
| 1       |
| 1       |
| 1       |
| 1       |
| 0       |
| 0       |
| 0       |
| 0       |
| 0       |
+---------+

if you do select _MAP['N_REGION_KEY'] from "sample-data/nation.parquet" order 
by _MAP['N_REGION_KEY'] desc;
You get and error something like below.  This is due to the fact that you 
specified a non-existent field.  Ultimately, this should just return null.  
However, in M1, we don't yet support support typeless null management in the 
expression trees.  Will update this bug to correctly state the failure and move 
to a later release.

Error in failure condition:

Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while 
running query.[error_id: "b3ef079f-eee9-449b-9f2f-d435106693ea"
endpoint {
  address: "jnmac"
  user_port: 31013
  bit_port: 31014
}
error_type: 0
message: "Failure while running fragment. < UnsupportedOperationException:[ 
NULL type is not supported. Mode: OPTIONAL ]"
]
java.lang.RuntimeException: org.apache.drill.exec.rpc.RpcException: Remote 
failure while running query.[error_id: "b3ef079f-eee9-449b-9f2f-d435106693ea"
endpoint {
  address: "jnmac"
  user_port: 31013
  bit_port: 31014
}
error_type: 0
message: "Failure while running fragment. < UnsupportedOperationException:[ 
NULL type is not supported. Mode: OPTIONAL ]"
]
        at 
org.apache.drill.sql.client.full.ResultEnumerator.moveNext(ResultEnumerator.java:44)
        at 
net.hydromatic.optiq.runtime.ObjectEnumeratorCursor.next(ObjectEnumeratorCursor.java:44)
        at 
net.hydromatic.optiq.jdbc.OptiqResultSet.next(OptiqResultSet.java:162)
        at sqlline.SqlLine$BufferedRows.<init>(SqlLine.java:2499)
        at sqlline.SqlLine.print(SqlLine.java:1886)
        at sqlline.SqlLine$Commands.execute(SqlLine.java:3835)
        at sqlline.SqlLine$Commands.sql(SqlLine.java:3738)
        at sqlline.SqlLine.dispatch(SqlLine.java:882)
        at sqlline.SqlLine.begin(SqlLine.java:717)
        at sqlline.SqlLine.mainWithInputRedirection(SqlLine.java:460)
        at sqlline.SqlLine.main(SqlLine.java:443)
Caused by: org.apache.drill.exec.rpc.RpcException: Remote failure while running 
query.[error_id: "b3ef079f-eee9-449b-9f2f-d435106693ea"
endpoint {
  address: "jnmac"
  user_port: 31013
  bit_port: 31014
}
error_type: 0
message: "Failure while running fragment. < UnsupportedOperationException:[ 
NULL type is not supported. Mode: OPTIONAL ]"
]
        at 
org.apache.drill.exec.rpc.user.QueryResultHandler.batchArrived(QueryResultHandler.java:72)
        at org.apache.drill.exec.rpc.user.UserClient.handle(UserClient.java:79)
        at 
org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:48)
        at 
org.apache.drill.exec.rpc.BasicClientWithConnection.handle(BasicClientWithConnection.java:33)
        at 
org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:142)
        at 
org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:127)
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
        at 
io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:334)
        at 
io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
        at 
io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:334)
        at 
io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
        at 
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173)
        at 
io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:334)
        at 
io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
        at 
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
        at 
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100)
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:497)
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:465)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:359)
        at 
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
        at java.lang.Thread.run(Thread.java:722)
                
> Exception running order by on nullable field
> --------------------------------------------
>
>                 Key: DRILL-215
>                 URL: https://issues.apache.org/jira/browse/DRILL-215
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Timothy Chen
>
> Running the following query in sqlline:
> select _MAP['N_NAME'] from "sample-data/nation.parquet" order by 
> _MAP['N_NAME'] desc;
> Gives me this exception
> at org.apache.drill.exec.expr.TypeHelper.getNewVector(TypeHelper.java:504) 
> ~[java-exec-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
> at 
> org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.setupNewSchema(ProjectRecordBatch.java:102)
>  ~[java-exec-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
> at 
> org.apache.drill.exec.record.AbstractSingleRecordBatch.next(AbstractSingleRecordBatch.java:36)
>  ~[java-exec-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
> at org.apache.drill.exec.physical.impl.sort.SortBatch.next(SortBatch.java:86) 
> ~[java-exec-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
> at 
> org.apache.drill.exec.record.AbstractSingleRecordBatch.next(AbstractSingleRecordBatch.java:25)
>  ~[java-exec-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
> at 
> org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.next(ScreenCreator.java:77)
>  ~[java-exec-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
> at org.apache.drill.exec.work.FragmentRunner.run(FragmentRunner.java:79) 
> ~[java-exec-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>  ~[na:1.7.0_25]
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>  ~[na:1.7.0_25]
> at java.lang.Thread.run(Thread.java:724) ~[na:1.7.0_25]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to