mirror of https://github.com/apache/druid.git
update/etc
This commit is contained in:
parent
6dd62fb7c6
commit
e81591499c
|
@ -330,6 +330,11 @@
|
|||
<groupId>com.github.docker-java</groupId>
|
||||
<artifactId>docker-java-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.hydromatic</groupId>
|
||||
<artifactId>quidem</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-transport-native-kqueue</artifactId>
|
||||
|
@ -457,6 +462,11 @@
|
|||
<groupId>org.apache.calcite.avatica</groupId>
|
||||
<artifactId>avatica-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.calcite</groupId>
|
||||
<artifactId>calcite-testkit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.os72</groupId>
|
||||
<artifactId>protobuf-dynamic</artifactId>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.apache.druid.quidem;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
import org.apache.druid.cli.GuiceRunnable;
|
||||
import org.apache.druid.java.util.common.lifecycle.Lifecycle;
|
||||
import org.apache.druid.java.util.common.logger.Logger;
|
||||
|
@ -28,6 +29,7 @@ import org.apache.druid.sql.calcite.SqlTestFrameworkConfig.SqlTestFrameworkConfi
|
|||
import org.apache.druid.sql.calcite.util.SqlTestFramework;
|
||||
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class Launcher
|
||||
{
|
||||
|
@ -43,9 +45,7 @@ public class Launcher
|
|||
public Launcher(String uri) throws Exception
|
||||
{
|
||||
SqlTestFrameworkConfig config = SqlTestFrameworkConfig.fromURL(uri);
|
||||
System.out.println("Config: " + config);
|
||||
configurationInstance = CONFIG_STORE.getConfigurationInstance(config);
|
||||
System.out.println("Configuration instance: " + configurationInstance);
|
||||
framework = configurationInstance.framework;
|
||||
}
|
||||
|
||||
|
@ -69,8 +69,11 @@ public class Launcher
|
|||
}
|
||||
}
|
||||
log.info("Starting Quidem with URI[%s]", quidemUri);
|
||||
Stopwatch stopwatch = Stopwatch.createStarted();
|
||||
Launcher launcher = new Launcher(quidemUri);
|
||||
log.info("Framework creation time: %d ms", stopwatch.elapsed(TimeUnit.MILLISECONDS));
|
||||
launcher.start();
|
||||
log.info("Total time to launch: %d ms", stopwatch.elapsed(TimeUnit.MILLISECONDS));
|
||||
launcher.lifecycle.join();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class QuidemCaptureResource
|
|||
|
||||
private File genRecordFilePath()
|
||||
{
|
||||
String fileName = StringUtils.format("record-%d.txt", System.currentTimeMillis());
|
||||
String fileName = StringUtils.format("record-%d.iq", System.currentTimeMillis());
|
||||
return new File(RECORD_PATH, fileName);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ public class QuidemRecorder implements AutoCloseable, DruidHook<String>
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
printStream.println("#started " + new Date());
|
||||
printStream.println("!connect " + quidemURI.toString());
|
||||
printStream.println("!use " + quidemURI.toString());
|
||||
DruidHook.register(DruidHook.SQL, this);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,10 @@
|
|||
|
||||
package org.apache.druid.quidem;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
|
@ -28,11 +31,7 @@ public class QTest extends DruidQuidemTestBase
|
|||
public QTest()
|
||||
{
|
||||
super();
|
||||
|
||||
assertEquals(
|
||||
QuidemCaptureResource.RECORD_PATH
|
||||
, getTestRoot());
|
||||
|
||||
assertEquals(QuidemCaptureResource.RECORD_PATH, getTestRoot());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,4 +39,13 @@ public class QTest extends DruidQuidemTestBase
|
|||
{
|
||||
return ProjectPathUtils.getPathFromProjectRoot("quidem-it/src/test/quidem/" + getClass().getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aa() {
|
||||
|
||||
List<String> n = getFileNames();
|
||||
for(String name : n) {
|
||||
run(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
#started
|
||||
!use druidtest:///
|
||||
!set outputformat mysql
|
||||
|
||||
select * from numfoo;
|
||||
+---------------------+------+------+-----------+------+------+------+-----+-----+-----+-----+--------+--------+-----+-----+-----+--------------------+
|
||||
| __time | dim1 | dim2 | dim3 | dim4 | dim5 | dim6 | d1 | d2 | f1 | f2 | l1 | l2 | cnt | m1 | m2 | unique_dim1 |
|
||||
+---------------------+------+------+-----------+------+------+------+-----+-----+-----+-----+--------+--------+-----+-----+-----+--------------------+
|
||||
| 2000-01-01 00:00:00 | | a | ["a","b"] | a | aa | 1 | 1.0 | | 1.0 | | 7 | | 1 | 1.0 | 1.0 | "AQAAAEAAAA==" |
|
||||
| 2000-01-02 00:00:00 | 10.1 | | ["b","c"] | a | ab | 2 | 1.7 | 1.7 | 0.1 | 0.1 | 325323 | 325323 | 1 | 2.0 | 2.0 | "AQAAAQAAAAHNBA==" |
|
||||
| 2000-01-03 00:00:00 | 2 | | d | a | ba | 3 | 0.0 | 0.0 | 0.0 | 0.0 | 0 | 0 | 1 | 3.0 | 3.0 | "AQAAAQAAAAOzAg==" |
|
||||
| 2001-01-01 00:00:00 | 1 | a | | b | ad | 4 | | | | | | | 1 | 4.0 | 4.0 | "AQAAAQAAAAFREA==" |
|
||||
| 2001-01-02 00:00:00 | def | abc | | b | aa | 5 | | | | | | | 1 | 5.0 | 5.0 | "AQAAAQAAAACyEA==" |
|
||||
| 2001-01-03 00:00:00 | abc | | | b | ab | 6 | | | | | | | 1 | 6.0 | 6.0 | "AQAAAQAAAAEkAQ==" |
|
||||
+---------------------+------+------+-----------+------+------+------+-----+-----+-----+-----+--------+--------+-----+-----+-----+--------------------+
|
||||
(6 rows)
|
||||
|
||||
!ok
|
||||
select * from numfoo;
|
||||
+---------------------+------+------+-----------+------+------+------+-----+-----+-----+-----+--------+--------+-----+-----+-----+--------------------+
|
||||
| __time | dim1 | dim2 | dim3 | dim4 | dim5 | dim6 | d1 | d2 | f1 | f2 | l1 | l2 | cnt | m1 | m2 | unique_dim1 |
|
||||
+---------------------+------+------+-----------+------+------+------+-----+-----+-----+-----+--------+--------+-----+-----+-----+--------------------+
|
||||
| 2000-01-01 00:00:00 | | a | ["a","b"] | a | aa | 1 | 1.0 | | 1.0 | | 7 | | 1 | 1.0 | 1.0 | "AQAAAEAAAA==" |
|
||||
| 2000-01-02 00:00:00 | 10.1 | | ["b","c"] | a | ab | 2 | 1.7 | 1.7 | 0.1 | 0.1 | 325323 | 325323 | 1 | 2.0 | 2.0 | "AQAAAQAAAAHNBA==" |
|
||||
| 2000-01-03 00:00:00 | 2 | | d | a | ba | 3 | 0.0 | 0.0 | 0.0 | 0.0 | 0 | 0 | 1 | 3.0 | 3.0 | "AQAAAQAAAAOzAg==" |
|
||||
| 2001-01-01 00:00:00 | 1 | a | | b | ad | 4 | | | | | | | 1 | 4.0 | 4.0 | "AQAAAQAAAAFREA==" |
|
||||
| 2001-01-02 00:00:00 | def | abc | | b | aa | 5 | | | | | | | 1 | 5.0 | 5.0 | "AQAAAQAAAACyEA==" |
|
||||
| 2001-01-03 00:00:00 | abc | | | b | ab | 6 | | | | | | | 1 | 6.0 | 6.0 | "AQAAAQAAAAEkAQ==" |
|
||||
+---------------------+------+------+-----------+------+------+------+-----+-----+-----+-----+--------+--------+-----+-----+-----+--------------------+
|
||||
(6 rows)
|
||||
|
||||
!ok
|
||||
select length(dim1) from numfoo;
|
||||
+--------+
|
||||
| EXPR$0 |
|
||||
+--------+
|
||||
| 0 |
|
||||
| 1 |
|
||||
| 1 |
|
||||
| 3 |
|
||||
| 3 |
|
||||
| 4 |
|
||||
+--------+
|
||||
(6 rows)
|
||||
|
||||
!ok
|
|
@ -1,4 +0,0 @@
|
|||
#started
|
||||
!connect druidtest:///
|
||||
select * from numfoo;
|
||||
!ok
|
Loading…
Reference in New Issue