use of org.apache.hive.service.rpc.thrift.TCLIService.Iface in project hive by apache.
the class TestHiveStatement method testSetFetchSize.
/**
* Gives the JDBC driver a hint as to the number of rows that should be
* fetched from the database when more rows are needed for ResultSet objects
* generated by this Statement. If the value specified is zero, then the hint
* is ignored. Test a value greater than zero is accepted.
*/
@Test
public void testSetFetchSize() throws SQLException {
final HiveConnection connection = mock(HiveConnection.class);
final Iface iface = mock(Iface.class);
final TSessionHandle handle = mock(TSessionHandle.class);
try (HiveStatement stmt = new HiveStatement(connection, iface, handle)) {
stmt.setFetchSize(123);
assertEquals(123, stmt.getFetchSize());
}
}
use of org.apache.hive.service.rpc.thrift.TCLIService.Iface in project hive by apache.
the class EmbeddedCLIServicePortal method get.
public static Iface get(Map<String, String> hiveConfs) {
TCLIService.Iface embeddedClient;
try {
Class<TCLIService.Iface> clazz = (Class<Iface>) Class.forName("org.apache.hive.service.cli.thrift.EmbeddedThriftBinaryCLIService");
embeddedClient = clazz.newInstance();
((Service) embeddedClient).init(buildOverlayedConf(hiveConfs));
} catch (ClassNotFoundException e) {
throw new RuntimeException("Please Load hive-service jar to the classpath to enable embedded mode");
} catch (Exception e) {
throw new RuntimeException("Error initializing embedded mode", e);
}
return embeddedClient;
}
Aggregations