yuhsak / livy-client

Simple REST client for Apache Livy
MIT License
6 stars 3 forks source link

Connect to a session that already exist?! #1

Closed argenisleon closed 5 years ago

argenisleon commented 5 years ago

Hi,

I am creating a session in a cluster from a backend app and I need another app to send a statement to that session. Is there a way in which I can tell livy-client to connect to a specific session?

yuhsak commented 5 years ago

If you know the session id you want to connect, how about trying this?

const livy = new LivyClient({
  host: 'your-host',
  port: '8998'
})

const session = livy.session({id: 'your-session-id'})

session
  .run('print("hi")', {autoupdate: true})
  .once('available', r => console.log(r.output))