Skip to content

Commit

Permalink
Added spotless check and copyright; fix #5, fix #6 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
stanbrub authored Jan 26, 2023
1 parent 0cd99d1 commit 1e6baff
Show file tree
Hide file tree
Showing 44 changed files with 3,348 additions and 2,785 deletions.
399 changes: 399 additions & 0 deletions eclipse-java-google-style.xml

Large diffs are not rendered by default.

36 changes: 35 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.10.1</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down Expand Up @@ -57,6 +57,34 @@
</execution>
</executions>
</plugin>
<plugin>
<!-- For spotless to work on Windows, Set git config global 'core.autocrlf' to true -->
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.30.0</version>
<configuration>
<java>
<includes>
<include>src/main/java/**/*.java</include>
<include>src/test/java/**/*.java</include>
</includes>
<eclipse>
<file>${project.basedir}/eclipse-java-google-style.xml</file>
<!-- <file>${project.basedir}/exportAllFormatter.xml</file> -->
</eclipse>
<licenseHeader>
<content>/* Copyright (c) 2022-$YEAR Deephaven Data Labs and Patent Pending */</content>
</licenseHeader>
</java>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down Expand Up @@ -156,6 +184,12 @@
<version>1.9.2</version>
</dependency>

<dependency>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.30.0</version>
</dependency>

</dependencies>

<repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,37 @@
import io.deephaven.benchmark.api.Bench;

public class KafkaToParquetStreamTest {
final Bench api = Bench.create(this);
final long scaleRowCount = api.propertyAsIntegral("scale.row.count", "1000");

@Test
public void makeParquetFile() {
api.table("orders").random()
.add("symbol", "string", "SYM[1-1000]")
.add("price", "float", "[10-20]")
.add("qty", "int", "1")
.generateParquet();

var query =
"""
from deephaven.parquet import read
from deephaven import agg
orders = read("/data/orders.parquet")
result = orders.view(formulas=["qty"]).agg_by([agg.sum_("RecCount = qty")], "qty")
""";

var tm = api.timer();
api.query(query).fetchAfter("result", table->{
assertEquals(scaleRowCount, table.getSum("RecCount").longValue(), "Wrong record count");
}).execute();
api.awaitCompletion();
api.result().test(tm, scaleRowCount);

}

@AfterEach
public void teardown() {
api.close();
}
final Bench api = Bench.create(this);
final long scaleRowCount = api.propertyAsIntegral("scale.row.count", "1000");

@Test
public void makeParquetFile() {
api.table("orders").random()
.add("symbol", "string", "SYM[1-1000]")
.add("price", "float", "[10-20]")
.add("qty", "int", "1")
.generateParquet();

var query = """
from deephaven.parquet import read
from deephaven import agg
orders = read("/data/orders.parquet")
result = orders.view(formulas=["qty"]).agg_by([agg.sum_("RecCount = qty")], "qty")
""";

var tm = api.timer();
api.query(query).fetchAfter("result", table -> {
assertEquals(scaleRowCount, table.getSum("RecCount").longValue(), "Wrong record count");
}).execute();
api.awaitCompletion();
api.result().test(tm, scaleRowCount);

}

@AfterEach
public void teardown() {
api.close();
}

}
Loading

0 comments on commit 1e6baff

Please sign in to comment.