Hey George, I only see DEBUG messages - so we can't say for sure that the query failed. It might just be taking longer time to execute or may be there could be an issue. You could check logs.
Are you able to execute the same query via sqlline and only hitting the issue via JDBC? Can you also share both the query profiles? -Abhishek On Sat, Jun 13, 2015 at 8:34 AM, George Lu <[email protected]> wrote: > Dear all, > > I have a query on hbase using Drill JDBC, the original is like : > SELECT COUNT(*) AS cnt FROM hbase.activities AS T WHERE T.row_key >= > '0000014de3597400' AND T.row_key < '0000014de87fd000' AND > CONVERT_FROM(T.log.d,'UTF8') <> 'ScanHandler' AND CAST(T.log.c AS INT) = 35 > AND CAST(T.log.`at` AS INT) = 1 > > And the code is like: > > Class.forName("org.apache.drill.jdbc.Driver"); > System.out.println("Beginning to establish connection..."); > Connection connection = DriverManager > > .getConnection("jdbc:drill:zk=prod2:2181,prod1:2181,prod3:2181/drill/drillprod;schema=hbase"); > Statement statement = connection.createStatement(); > System.out.println("Beginning to execute query..."); > String scanCountQuery = "SELECT COUNT(*) AS cnt FROM hbase.activities AS T > WHERE T.row_key >= '%s' AND T.row_key < '%s' AND > CONVERT_FROM(T.log.d,'UTF8') <> 'ScanHandler' AND CAST(T.log.c AS INT) = 35 > AND CAST(T.log.`at` AS INT) = 1"; > scanCountQuery = String.format(scanCountQuery, startRowKey, endRowKey); > System.out.println(scanCountQuery); > ResultSet resultSet = statement > .executeQuery(scanCountQuery); > resultSet.next(); > String scanCount = resultSet.getString("cnt"); > > After I execute the code, I get below and the program cannot stop > 22:50:01.666 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:50:04.718 [Client-1] INFO o.a.drill.exec.rpc.user.UserClient - Channel > closed /10.20.18.66:42734 <--> prod7/10.20.18.66:31010. > 22:50:15.012 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:50:28.358 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:50:41.706 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:50:55.049 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:51:08.391 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:51:21.739 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:51:35.082 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:51:48.430 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:52:01.778 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:52:15.118 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:52:28.459 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:52:41.805 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:52:55.153 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:53:08.493 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:53:21.839 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:53:35.186 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 3ms > 22:53:48.522 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:54:01.870 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > 22:54:15.216 [main-SendThread(prod2:2181)] DEBUG > org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: > 0x24b6d151e361f0b after 1ms > ............ > > If I change to select CONVERT_FROM(row_key,'UTF8'), the program terminates > as expected with all the row keys printed. > > Please kindly suggest what is error. > > Thanks! > > George Lu >
