class Multiwoven::Integrations::Source::AwsAthena::Client

def discover(connection_config)

def discover(connection_config)
  connection_config = connection_config.with_indifferent_access
  query = "SELECT table_name, column_name, data_type, is_nullable FROM information_schema.columns WHERE table_schema = '#{connection_config[:schema]}' ORDER BY table_name, ordinal_position;"
  db = create_connection(connection_config)
  results = query_execution(db, query)
  catalog = Catalog.new(streams: create_streams(results))
  catalog.to_multiwoven_message
rescue StandardError => e
  handle_exception(e, {
                     context: "AWS:ATHENA:DISCOVER:EXCEPTION",
                     type: "error"
                   })
end