Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improved queryAll() to use less mem #1779

Merged
merged 4 commits into from
Aug 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into fix_testing_client_v2
  • Loading branch information
chernser committed Aug 27, 2024
commit 57f89010c729a4f53262a3ac54cd6d4badc234c7
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.BaseStream;
import java.util.stream.IntStream;
import java.util.stream.Collectors;

public class QueryTests extends BaseIntegrationTest {
Expand Down Expand Up @@ -149,7 +150,7 @@ public void testSimpleQueryWithTSV() {
@Test(groups = {"integration"})
public void testReadRecords() throws Exception {
List<Map<String, Object>> dataset = prepareDataSet(DATASET_TABLE, DATASET_COLUMNS, DATASET_VALUE_GENERATORS, 10);

Records records = client.queryRecords("SELECT * FROM " + DATASET_TABLE).get(3, TimeUnit.SECONDS);
Assert.assertEquals(records.getResultRows(), 10, "Unexpected number of rows");

Expand All @@ -164,6 +165,22 @@ public void testReadRecords() throws Exception {
}
}

@Test(groups = {"integration"})
public void testBigUnsignedInt() throws Exception {
final BigInteger expected128 = BigInteger.valueOf(2).pow(128).subtract(BigInteger.ONE).subtract(BigInteger.ONE);
final BigInteger expected256 = BigInteger.valueOf(2).pow(256).subtract(BigInteger.ONE).subtract(BigInteger.ONE);

String sqlQuery = "SELECT toUInt128('" + expected128 + "') as i128, toUInt256('" + expected256 + "') as i256";
System.out.println(sqlQuery);
Records records = client.queryRecords(sqlQuery).get(3, TimeUnit.SECONDS);

GenericRecord firstRecord = records.iterator().next();

System.out.println(firstRecord.getBigInteger("i128"));
Assert.assertEquals(firstRecord.getBigInteger("i128"), expected128);
Assert.assertEquals(firstRecord.getBigInteger("i256"), expected256);
}

@Test(groups = {"integration"})
public void testReadRecordsWithStreamAPI() throws Exception {
final int tables = 10;
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.