Dear all,

for the count query, I use if (result.next()) to go next once.

For the other query, I don't close the result and the program still
completes, but I close it :)
I guess the original slowness may due to latency of query.

So, till now, the JDBC driver works fine (I use DRILL 0.9.0).

Thanks!

George

On Mon, Jun 15, 2015 at 8:56 PM, Jacques Nadeau <[email protected]> wrote:

> George,
>
> It looks like your example code doesn't close out the jdbc client nor does
> it read the result all the way to a false status.   I'm guessing this is
> the problem.  If so,  you can workaround by closing the connection at the
> end of your program.
>
> Let us know if this fixes things and we can get a jira up to make sure all
> jdbc client threads are daemon threads.
>  On Jun 14, 2015 5:34 PM, "George Lu" <[email protected]> wrote:
>
> > Hi Abhishek,
> >
> > I can query by sqlline by count(*) group query, it works fine.
> > Maybe I will try wait for longer to see, the log is Zookeeper keep
> > connection by JDBC client.
> >
> > I will let you guys know.
> >
> > Thanks!
> >
> > George
> >
> > On Sun, Jun 14, 2015 at 10:49 PM, Abhishek Girish <
> > [email protected]
> > > wrote:
> >
> > > 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
> > > >
> > >
> >
>

Reply via email to