I want to select value from UI(drop down) and pass this value to Hive and generate table.
library(shiny)
library(glue)
library(RJDBC)
library(rJava)
library(sqldf)
ui <- fluidPage(
selectInput("inSelect", "Select Item:",
choices=list('Item1','Item2',"Item3")
),
tableOutput(outputId = "query")
)
server <- function(input, output) {
output$query <- renderTable({
drv <- JDBC("org.apache.hive.jdbc.HiveDriver",identifier.quote="`")
conn <- dbConnect
db <- dbGetQuery(conn, "show databases")
query <-dbGetQuery(conn,
"select * from table1
where month>='2019' and Item= '{input$inSelect}'")
})
}
shinyApp(ui = ui, server = server)
```R
I getting the user selection but unable to get output table. Once the drop down is selected no action takes place. Please any help would be greatly appreciated.