Hi,
I created a simple program to test insert query to dremio cloud. But it hangs when attempting to execute an SQL update using the Arrow Flight SQL client. Please advise!
I am using data.dremio.cloud with 443 port.
private static void runFlightCallDirectInsert(Location location,
BufferAllocator allocator,
String token) throws Exception {
try (FlightClient client = FlightClient.builder(allocator, location)
.build();
FlightSqlClient sqlClientA = new FlightSqlClient(client) {
CredentialCallOption credentialCallOption = new CredentialCallOption((callHeaders) → {
callHeaders.insert(“authorization”, "Bearer " + token);
});
int newid = Long.valueOf(Instant.now().getEpochSecond()).intValue();
String insertSqlQuery = String.format(
“INSERT INTO "test-cat-1"."my_folder".people3 (id, name, age) values (%d, ‘%s’, %d)”,
newid, “name_” + newid, 5);
long insertedCount =
sqlClientA.executeUpdate(insertSqlQuery, credentialCallOption);
String querySql = "SELECT * FROM \"test-cat-1\".\"my_folder\".people2 WHERE id >= " + newid;
FlightInfo flightInfo = sqlClientA.execute(querySql, credentialCallOption);
System.out.println("printing results within the transaction client A");
printFlightInfoResults(flightInfo, sqlClientA);
} catch (Exception ex) {
ex.printStackTrace();
}
}