0

I need to connect RStudio to ClickHouse and then be able to run SQL queries in R Markdown, generating a pre-formatted table that I can view in the environment instead of a string that needs to be parsed with another function.

I tried to connect with:

   con_click <- clickhouse_http_api(
   host = host,
   port = port,
   user = user,
   password = password,
   dbname =)

but i have this error "Error in clickhouse_http_api(host = host, port = port, user = user, password = password, : could not find function "clickhouse_http_api""

I tried also with: library(httr)

#Config connection
   url <- "http://xxxxxx/"
   user <- "xxxx"
   password <- "xxxxx"

   query <- "select * from aaa.aaa_detail aum LIMIT 10"

#Query execution
   response <- GET(url, authenticate(user, password), query = list(query = query))

This connection works, but the response is a list e not a table.

I would like to create a connection that allows me to use a query like this (in R markdown)

```{sql connection=con_click,  output.var=prova}
   select *
   from aaa.aaa_detail pd 
   limit 10

Someone can help me? Thank you Elisa

1 Answer 1

-1

Look examples how to connect properly in https://github.com/IMSMWU/RClickHouse

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you, but i can't find RClickhouse package, there is an issue in github github.com/IMSMWU/RClickhouse/issues/112

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.