Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ protected AbstractBinaryFormatReader(InputStream inputStream, QuerySettings quer
* @throws IOException
*/
public boolean readToPOJO(Map<String, POJOSetter> deserializers, Object obj ) throws IOException {
if (columns == null || columns.length == 0) {
return false;
}

boolean firstColumn = true;

for (ClickHouseColumn column : columns) {
Expand Down Expand Up @@ -135,6 +139,10 @@ public boolean readToPOJO(Map<String, POJOSetter> deserializers, Object obj ) th
* @throws IOException
*/
public boolean readRecord(Map<String, Object> record) throws IOException {
if (columns == null || columns.length == 0) {
return false;
}

boolean firstColumn = true;
for (ClickHouseColumn column : columns) {
try {
Expand All @@ -157,6 +165,10 @@ public boolean readRecord(Map<String, Object> record) throws IOException {
}

protected boolean readRecord(Object[] record) throws IOException {
if (columns == null || columns.length == 0) {
return false;
}

boolean firstColumn = true;
for (int i = 0; i < columns.length; i++) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,14 @@ public void testQueryAllTableNames() {
Assert.assertTrue(tableNames.containsAll(expectedTableNames));
}

@Test(groups = {"integration"})
public void testQueryAllInsertSelect() {
client.queryAll("CREATE TABLE IF NOT EXISTS nums (number Int16) ENGINE = MergeTree() ORDER BY number;");
String sql = "INSERT INTO nums SELECT * FROM system.numbers LIMIT 100";
List<GenericRecord> records = client.queryAll(sql);
Assert.assertTrue(records.isEmpty());
}

@Test(groups = {"integration"})
public void testQueryJSONEachRow() throws ExecutionException, InterruptedException {
Map<String, Object> datasetRecord = prepareSimpleDataSet();
Expand Down
Loading