Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 804 Bytes

README.md

File metadata and controls

28 lines (19 loc) · 804 Bytes

impala-scala

This is a scala client for Cloudera Impala. You can use it like this:

import com.daniellesucher.impala.{Cursor, ImpalaClient}

val client = ImpalaClient("host", 21000)
client.execute("SHOW TABLES")
// => merchants users...

You can also use a cursors to iterate over the rows. This lets you pass in any function you like, and avoid loading the entire result set into memory at once.

import com.daniellesucher.impala.{Cursor, ImpalaClient}

val client = ImpalaClient("host", 21000)
val cursor = client.query("SELECT zip, income FROM zipcode_incomes ORDER BY income DESC")

cursor.foreach { row: Seq[ImpalaValue] =>
  // whatever makes you happy
}

cursor.close