|
74 | 74 | import java.util.Random; |
75 | 75 | import java.util.Set; |
76 | 76 | import java.util.UUID; |
77 | | -import java.util.concurrent.CountDownLatch; |
78 | | -import java.util.concurrent.ExecutionException; |
79 | | -import java.util.concurrent.ExecutorService; |
80 | | -import java.util.concurrent.Executors; |
81 | | -import java.util.concurrent.Future; |
82 | | -import java.util.concurrent.TimeUnit; |
| 77 | +import java.util.concurrent.*; |
83 | 78 | import java.util.concurrent.atomic.AtomicInteger; |
84 | 79 | import java.util.function.Consumer; |
85 | 80 | import java.util.function.Function; |
@@ -1562,6 +1557,34 @@ public void testQueryParams() throws Exception { |
1562 | 1557 | Assert.assertEquals(allRecords.size(), 2); |
1563 | 1558 | } |
1564 | 1559 |
|
| 1560 | + @Test(groups = {"integration"}) |
| 1561 | + public void testExecuteQueryParam() throws ExecutionException, InterruptedException, TimeoutException { |
| 1562 | + |
| 1563 | + final String table = "execute_query_test"; |
| 1564 | + Map<String, Object> query_param = Map.of("table_name",table, "engine","MergeTree"); |
| 1565 | + client.execute("DROP TABLE IF EXISTS " + table).get(10, TimeUnit.SECONDS); |
| 1566 | + client.execute("CREATE TABLE {table_name:Identifier} ( id UInt32, name String, created_at DateTime) ENGINE = MergeTree ORDER BY tuple()", query_param) |
| 1567 | + .get(10, TimeUnit.SECONDS); |
| 1568 | + |
| 1569 | + TableSchema schema = client.getTableSchema(table); |
| 1570 | + Assert.assertNotNull(schema); |
| 1571 | + } |
| 1572 | + |
| 1573 | + @Test(groups = {"integration"}) |
| 1574 | + public void testExecuteQueryParamCommandSettings() throws ExecutionException, InterruptedException, TimeoutException { |
| 1575 | + |
| 1576 | + final String table = "execute_query_test"; |
| 1577 | + String q1Id = UUID.randomUUID().toString(); |
| 1578 | + Map<String, Object> query_param = Map.of("table_name",table, "engine","MergeTree"); |
| 1579 | + client.execute("DROP TABLE IF EXISTS " + table).get(10, TimeUnit.SECONDS); |
| 1580 | + client.execute("CREATE TABLE {table_name:Identifier} ( id UInt32, name String, created_at DateTime) ENGINE = MergeTree ORDER BY tuple()", |
| 1581 | + query_param, (CommandSettings) new CommandSettings().setQueryId(q1Id)) |
| 1582 | + .get(10, TimeUnit.SECONDS); |
| 1583 | + |
| 1584 | + TableSchema schema = client.getTableSchema(table); |
| 1585 | + Assert.assertNotNull(schema); |
| 1586 | + } |
| 1587 | + |
1565 | 1588 | @Test(groups = {"integration"}) |
1566 | 1589 | public void testGetTableSchema() throws Exception { |
1567 | 1590 |
|
|
0 commit comments