mirror of
https://github.com/apache/lucene.git
synced 2025-02-09 03:25:15 +00:00
SOLR-8799: Improve error message when tuple can't be read by SolrJ JDBC
This commit is contained in:
parent
4384627f08
commit
56ad6e5d8a
@ -78,7 +78,7 @@ class ResultSetImpl implements ResultSet {
|
|||||||
this.firstTuple = this.solrStream.read();
|
this.firstTuple = this.solrStream.read();
|
||||||
this.solrStream.pushBack(firstTuple);
|
this.solrStream.pushBack(firstTuple);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new SQLException("Couldn't read first tuple", e);
|
throw new SQLException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.resultSetMetaData = new ResultSetMetaDataImpl(this);
|
this.resultSetMetaData = new ResultSetMetaDataImpl(this);
|
||||||
|
@ -396,6 +396,21 @@ public class JdbcTest extends AbstractFullDistribZkTestBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Test error propagation
|
||||||
|
props = new Properties();
|
||||||
|
props.put("aggregationMode", "facet");
|
||||||
|
try (Connection con = DriverManager.getConnection("jdbc:solr://" + zkHost + "?collection=collection1", props)) {
|
||||||
|
try (Statement stmt = con.createStatement()) {
|
||||||
|
try (ResultSet rs = stmt.executeQuery("select crap from collection1 group by a_s " +
|
||||||
|
"order by sum(a_f) desc")) {
|
||||||
|
} catch (Exception e) {
|
||||||
|
String errorMessage = e.getMessage();
|
||||||
|
assertTrue(errorMessage.contains("Group by queries must include atleast one aggregate function"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
testDriverMetadata();
|
testDriverMetadata();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user