Skip to content

Commit

Permalink
update/etc
Browse files Browse the repository at this point in the history
  • Loading branch information
kgyrtkirk committed Jun 18, 2024
1 parent 6dd62fb commit e815914
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 13 deletions.
10 changes: 10 additions & 0 deletions quidem-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
7 changes: 5 additions & 2 deletions quidem-it/src/main/java/org/apache/druid/quidem/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,6 +29,7 @@
import org.apache.druid.sql.calcite.util.SqlTestFramework;

import java.util.Properties;
import java.util.concurrent.TimeUnit;

public class Launcher
{
Expand All @@ -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;
}

Expand All @@ -69,8 +69,11 @@ public static void main(String[] args) throws Exception
}
}
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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public synchronized String start()

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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public QuidemRecorder(URI quidemURI, File file)
throw new RuntimeException(e);
}
printStream.println("#started " + new Date());
printStream.println("!connect " + quidemURI.toString());
printStream.println("!use " + quidemURI.toString());
DruidHook.register(DruidHook.SQL, this);
}

Expand Down
18 changes: 13 additions & 5 deletions quidem-it/src/test/java/org/apache/druid/quidem/QTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -28,16 +31,21 @@ public class QTest extends DruidQuidemTestBase
public QTest()
{
super();

assertEquals(
QuidemCaptureResource.RECORD_PATH
, getTestRoot());

assertEquals(QuidemCaptureResource.RECORD_PATH, getTestRoot());
}

@Override
protected File getTestRoot()
{
return ProjectPathUtils.getPathFromProjectRoot("quidem-it/src/test/quidem/" + getClass().getName());
}

@Test
public void aa() {

List<String> n = getFileNames();
for(String name : n) {
run(name);
}
}
}
Original file line number Diff line number Diff line change
@@ -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

This file was deleted.

0 comments on commit e815914

Please sign in to comment.