// hogeςʔϒϧͷதΛऔಘ
val sql = ‘SELECT * FROM hoge’
val client = TDClient.newClient()
val jobRequest = TDJobRequest.newPrestoQuery(dbName, sql)
val jobId = client.submit(jobRequest)
val backOff = new ExponentialBackOff
while (!client.jobStatus(jobId).getStatus.isFinished) {
Thread.sleep(backOff.nextWaitTimeMillis)
}
val input = client.jobResult(jobId, TDResultFormat.MESSAGE_PACK_GZ, new
Function[InputStream, InputStream] {
def apply(input: InputStream) = input
}
val unpacker = MessagePack.newDefaultUnpacker(new
GZIPInputStream(input))
Slide 73
Slide 73 text
͍…ʢ´ɾωɾʆʣ
Slide 74
Slide 74 text
// hogeςʔϒϧͷதΛऔಘ
val sql = ‘SELECT * FROM hoge’
val client = TDClient.newClient()
val jobRequest = TDJobRequest.newPrestoQuery(dbName, sql)
val jobId = client.submit(jobRequest)
val backOff = new ExponentialBackOff
while (!client.jobStatus(jobId).getStatus.isFinished) {
Thread.sleep(backOff.nextWaitTimeMillis)
}
val input = client.jobResult(jobId, TDResultFormat.MESSAGE_PACK_GZ, new
Function[InputStream, InputStream] {
def apply(input: InputStream) = input
}
val unpacker = MessagePack.newDefaultUnpacker(new
GZIPInputStream(input))
1. ΫΤϦΛ࣮ߦ
Slide 75
Slide 75 text
// hogeςʔϒϧͷதΛऔಘ
val sql = ‘SELECT * FROM hoge’
val client = TDClient.newClient()
val jobRequest = TDJobRequest.newPrestoQuery(dbName, sql)
val jobId = client.submit(jobRequest)
val backOff = new ExponentialBackOff
while (!client.jobStatus(jobId).getStatus.isFinished) {
Thread.sleep(backOff.nextWaitTimeMillis)
}
val input = client.jobResult(jobId, TDResultFormat.MESSAGE_PACK_GZ, new
Function[InputStream, InputStream] {
def apply(input: InputStream) = input
}
val unpacker = MessagePack.newDefaultUnpacker(new
GZIPInputStream(input))
2. ΫΤϦऴྃ·Ͱͭ
Slide 76
Slide 76 text
// hogeςʔϒϧͷதΛऔಘ
val sql = ‘SELECT * FROM hoge’
val client = TDClient.newClient()
val jobRequest = TDJobRequest.newPrestoQuery(dbName, sql)
val jobId = client.submit(jobRequest)
val backOff = new ExponentialBackOff
while (!client.jobStatus(jobId).getStatus.isFinished) {
Thread.sleep(backOff.nextWaitTimeMillis)
}
val input = client.jobResult(jobId, TDResultFormat.MESSAGE_PACK_GZ, new
Function[InputStream, InputStream] {
def apply(input: InputStream) = input
}
val unpacker = MessagePack.newDefaultUnpacker(new
GZIPInputStream(input))
3. ݁ՌΛऔಘ