【发布时间】:2019-07-15 17:48:16
【问题描述】:
所以,我正在尝试向 Rshiny 应用程序输出查询,但输出中不断出现错误。这是我的输出:
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
library(DBI)
for Spark 2.1.X
Sys.setenv(SPARK_HOME="/opt/cloudera/parcels/SPARK2/lib/spark2/")
Sys.setenv(SPARK_HOME_VERSION="2.1.0")
#Connecting to Spark
sc <- spark_connect(master ="yarn-client")
ui <- fluidPage(
numericInput("nrows", "Enter the number of rows to display:", 5),
tableOutput("tbl")
)
server <- function(input, output, session) {
output$tbl <- renderTable({
iris_preview <- dbGetQuery(sc,"select * from sndbx_dx.ncct_mapping limit 3")
iris_preview
})
}
shinyApp(ui, server)
我只是想让 iris_preview 在我运行它时显示在闪亮的应用程序中。有人看到我做错了吗?
自从我连接到 spark 后,我想从我的 Hive 数据库中输出表。
【问题讨论】:
标签: r shiny rstudio dbi sparklyr