OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

skipping JDBC API (or ResultSet metadata / pagination)


Hello,

Is there a way to get Enumerator<T> directly from RelNode bypassing JDBC
calls like createStatement() / executeQuery()  ?

I'm looking for something like this:

RelBuilder builder  = .....
RelNode filter = builder.scan("mySchema", "myTable").filter().build();

Enumerable<T> result = something.execute(filter);

Follow-up question (or workaround). Some datasources (like Elastic
<https://www.elastic.co/guide/en/elasticsearch/reference/current/_the_search_api.html>)
return total number of documents matching the criteria in addition to
current result (which can be smaller than total number):

hits: {
   total: 200,
   hits: [{...}, {...}] // can be smaller than 200 (batch)
}

Is there a way to expose that information to the user in ResultSet (useful
during pagination) ? Otherwise one has to perform two queries:

select count(*) from foo where $filter
select * from foo where $filter LIMIT $batch

Regards,
Andrei.