3

I want to run select Sql Server Query at one time. I am using Drill in embedded mode.

select * from <storagePluginName1>.<schemaName>.<tableName>;

select * from <storagePluginName2>.<schemaName>.<tableName>;

Example:-

select * from SqlServer.dbo.`Category`;
select * from sqldemo.dbo.`Attributes`;

Whether Apache Drill Supports Multiple Query at one time or not.??? If Yes then How.??

Naveen D
  • 121
  • 2
  • 17
  • 1
    No, you can't run multiple queries from Drill. I tested from drill-shell, web-UI, Rest API, I gave me exception. – Dev Mar 28 '16 at 04:54
  • what exception are you getting ? it may be tricky to run multiple queries in parallel from Sqlline, but you can definitely run queries in parallel from the web-UI or using the JDBC driver – adeneche Mar 29 '16 at 21:18
  • @adeneche what would be that trick...:) – Dev Mar 31 '16 at 07:10
  • @devツ you mean from sqlline ? if Drill is running in distributed mode (and not in embedded mode) then you can launch multiple sqlline instances connected to the Drill cluster, then each Sqlline instance will be able to submit queries independently of the other running instances – adeneche Mar 31 '16 at 08:08
  • @adeneche yes we can do that in distributed mode. I wrote in context of embedded mode. OP is using Drill in embedded mode (_not mention in the question but I have context from his older questions_) – Dev Mar 31 '16 at 08:34
  • i am using drill in embedded mode. Is it possible to run multiple query in embedded mode.? – Naveen D Mar 31 '16 at 10:20
  • @devツ actually you can do that even in embedded mode, I just tried it :P posting an answer explaining how to do it right away – adeneche Mar 31 '16 at 10:21
  • @NaveenD can you edit the question to make it clear you are running in embedded mode ? this will help future readers. Thanks – adeneche Mar 31 '16 at 10:33

2 Answers2

0

So, you are running in embedded mode and want to run multiple queries in parallel from sqlline. Here is how to do it:

  • after you start Drill, do to the webUI and check the value displayed for "User Port", let's say it's: 172.30.1.119:31010
  • you can create other sqlline instances connected to the same Drillbit by running

    sqlline -u jdbc:drill:drillbit=172.30.1.119:31010

Now you will be able to submit parallel queries from those sqlline instances. You can check in the webUI that the queries are running at the same time indeed.

Dev
  • 13,492
  • 19
  • 81
  • 174
adeneche
  • 182
  • 4
  • 2
    This is same as opening additional drill ui tabs in browser and fire multiple queries. I think OP question is what if sequence is important for multiple queries. eg. `use dfs.tmp; alter session set `store.format`='csv'; create table dfs.tmp.my_output as select * from cp.\`employee.json\`;` – nir Jul 11 '16 at 23:22
0

Unfortunately the answer is NO, at least from the version I used(1.15). Drill parser would regards the ';' separator as an illegal character.

0: jdbc:drill:drillbit=localhost:3001> select 1; select 1;
Error: PARSE ERROR: Encountered ";" at line 1, column 9.
Was expecting one of:
...   
Ben
  • 179
  • 1
  • 3