Monthly Archives: March 2021

Shiny How to Write Helloworld R example

library(shiny)
library(DT)
library(RJDBC)
server <- function(input, output, session) {
if (Sys.getenv(“SHINY_ACCESS_LOGDIR”) != “”) {
access_file <- file.path(Sys.getenv(“SHINY_ACCESS_LOGDIR”),
paste0(basename(getwd()), “-“, basename(dirname(getwd())), “.log”))
cat(paste(“[“, format(Sys.time(), tz = “America/Chicago”), “] -“, session$user, “\n”),
file = access_file, append = TRUE)
}
vals <- reactiveValues(user = “”, pwd = “”, data = NULL)

observeEvent(input$query, {
showModal(
modalDialog(
textAreaInput(“sSQL”, “Type your query here:”, “select * from SqlAgentJob_RunToday “, width = “500px”, height = “50px”)
,
footer = tagList(
modalButton(“Cancel”),
actionButton(“QueryOK”, “OK”)
)

)
)
})
observeEvent(input$userpwd, {
showModal(
modalDialog(
selectInput(“vdb”,label = h3(“Select VDB:”), choices = c(“demo” = “demo”,”DV_Reinsurance” = “DV_Reinsurance”,”DA” = “DA”,”Claims” = “Claims”
,”DW” = “DW”,”TDV_EMOM” = “TDV_EMOM”,”TDV_Reports” = “TDV_Reports”,”TDV_PREM” = “TDV_PREM”)),
textInput(“user”, “Enter username”),
passwordInput(“pwd”, “Enter password”),
radioButtons(“loginType”, “Login Type:”,
c(“AD Authentication” = “AD”,
“Application (Composite)” = “App”)),
footer = tagList(
modalButton(“Cancel”),
actionButton(“ok”, “OK”)
)
)
)
})

observeEvent(input$ok, {
vals$vdb = input$vdb
vals$user = input$user
vals$pwd = input$pwd
vals$loginType = input$loginType
removeModal()
})

observeEvent(input$QueryOK, {
vals$sSQL = input$sSQL

removeModal()
})

observeEvent(input$get_data, {

jdbcUrl <-“jdbc:compositesw:dbapi@tdvhost01:9401?domain=composite&dataSource=”
if(vals$loginType ==”AD”)
{
jdbcUrl <-“jdbc:compositesw:dbapi@tdvhost01:9401?domain=xyz.com&dataSource=”

}

con <- try(
dbConnect(JDBC(driverClass = “cs.jdbc.driver.CompositeDriverx”,
classPath = “csjdbc.jar”),
paste0(jdbcUrl,vals$vdb),
user = vals$user, password = vals$pwd)
)
sSQL<-“select * from TDV.TDV_SOURCE.TDV_DB_LIST”

sSQL<- vals$sSQL

if (!inherits(con, “try-error”)) {
#res <- try(dbGetQuery(con, paste(“select * from”, input$table)))
res <- try(dbGetQuery(con, paste(sSQL)))
#res <- try(dbGetQuery(con, “Select top 10 * from DataSys.TibcoDV.TDV_Access_Sessions”))
if (!inherits(res, “try-error”)) {
vals$data <- res
}
}
})
output$result_dt <- DT::renderDataTable({
req(vals$data)
datatable(vals$data,
rownames = FALSE,
options = list(scrollX = TRUE, pageLength = 20))
})

output$dl_result <- renderUI({
req(vals$data)
downloadButton(“download_data”, “Download csv file”)
})

output$download_data <- downloadHandler(
filename = function() { “data.csv” },
content = function(file) {
write.csv(vals$data, file, row.names = FALSE)
}
)
}

Shiny Server Installation Process 2

How to install and config a shiny server on CentOS VM?

#From a centos VM (7.x)

 

sudo yum install R

sudo su –c “R -e \”install.packages(‘shiny’, repos=’https://cran.rstudio.com/’)\””

 

 

wget https://download3.rstudio.org/centos6.3/x86_64/shiny-server-1.5.9.923-x86_64.rpm

 

sudo yum install –nogpgcheck shiny-server-1.5.9.923-x86_64.rpm

 

vi /etc/shiny-server/shiny-server.config

 

# change line

 

listen 3838;

 

#to

 

listen 3838 0.0.0.0;

 

#to allow remote access

 

#open port for access

 

firewall-cmd –zone=public –add-port=3838/tcp –permanent

 

firewall-cmd –reload

 

#start the server

systemctl start shiny-server

 

# check the status of server open browser and type in

 

http://10.206.97.55:3838/

 

#where you need to put in your VM IP

Shiny Server installation Process

sudo yum install R
sudo su –c “R -e \”install.packages(‘shiny’, repos=’https://cran.rstudio.com/’)\””

wget https://download3.rstudio.org/centos6.3/x86_64/shiny-server-1.5.9.923-x86_64.rpm

vi /etc/shiny-server/shiny-server.config

change

listen 3838;
to listen 3838 0.0.0.0;

firewall-cmd –zone=public –add-port=3838/tcp –permanent

firewall-cmd –reload

systemctl start shiny-server

open browser and type in

http://10.206.97.55:3838/

where you need to put in your VM IP

Python SF upsert example 2

from salesforce_bulkipy import SalesforceBulkipy

bulk = SalesforceBulkipy(username=”dummy@xyz.com”, password=”P@ssme99#”, security_token=”abY55tLsHyUK6T8k4IOFcoCl”)

records_to_upsert = [{“Quote_Number__c:””, “Name”:””,”StageName”:””, “CloseDate”:””}, {‘Quote_Number__c, Name,StageName, CloseDate’}] # A list of A Custom Object dict

# Bulk Upsert
query = ” # SOQL Query
job = bulk.create_upsert_job(“Opportunity”, external_id_name=”Quote_Number__c”, contentType=’CSV’)
csv_iter = CsvDictsAdapter(iter(records_to_upsert))
batch = bulk.post_bulk_batch(job, csv_iter)
bulk.wait_for_batch(job, batch)
bulk.close_job(job)

#SalesforceBulkipy + post_bulk_batch

How to do a bulk update in Python for SF

import csv
from salesforce_bulk import SalesforceBulk
from salesforce_bulk import CsvDictsAdapter
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse

bulk = SalesforceBulk(username=”dummy@xyz.com”, password=”Password”, security_token=”abY55tLsHyUK6T8k4IOFcoCl”, sandbox=”True” )

job = bulk.create_upsert_job(“Opportunity”, external_id_name=”Quote_Number__c”, contentType=’CSV’)
reader = csv.DictReader(open(‘update2.csv’))
disbursals = []
for row in reader:
disbursals.append(row)

csv_iter = CsvDictsAdapter(iter(disbursals))
batch = bulk.post_batch(job, csv_iter)
bulk.wait_for_batch(job, batch)
bulk.close_job(job)
print(“Done. Data Uploaded.”)

Snowflake Kafka Connect Runlog example

{“name”:”sinkSnowFlake”,”connector”:{“state”:”RUNNING”,”worker_id”:”127.0.0.1:8083″},”tasks”:[{“id”:0,”state”:”FAILED”,”worker_id”:”127.0.0.1:8083″,”trace”:”org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception.\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:567)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n\tat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n\tat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: com.snowflake.kafka.connector.internal.SnowflakeKafkaConnectorException: \n[SF_KAFKA_CONNECTOR] Exception: Failed to create stage\n[SF_KAFKA_CONNECTOR] Error Code: 2008\n[SF_KAFKA_CONNECTOR] Detail: Failed to create stage on Snowflake, please check that you have permission to do so.\n[SF_KAFKA_CONNECTOR] Message: SQL compilation error:\n[SF_KAFKA_CONNECTOR] Database ‘SNOWFLAKE_KAFKA_CONNECTOR_SINKSNOWFLAKE_STAGE_DBDEMO’ does not exist or not authorized.\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:152)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:77)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:495)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:372)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:575)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:265)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:203)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.execute(SFStatement.java:874)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeStatementV1.executeInternal(SnowflakeStatementV1.java:309)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakePreparedStatementV1.execute(SnowflakePreparedStatementV1.java:516)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:145)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.FutureTask.run(FutureTask.java:266)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n[SF_KAFKA_CONNECTOR] java.lang.Thread.run(Thread.java:748)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:397)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:373)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:360)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:149)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n\tat com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n\t… 10 more\n”},{“id”:1,”state”:”FAILED”,”worker_id”:”127.0.0.1:8083″,”trace”:”org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception.\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:567)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n\tat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n\tat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: com.snowflake.kafka.connector.internal.SnowflakeKafkaConnectorException: \n[SF_KAFKA_CONNECTOR] Exception: Failed to create stage\n[SF_KAFKA_CONNECTOR] Error Code: 2008\n[SF_KAFKA_CONNECTOR] Detail: Failed to create stage on Snowflake, please check that you have permission to do so.\n[SF_KAFKA_CONNECTOR] Message: SQL compilation error:\n[SF_KAFKA_CONNECTOR] Database ‘SNOWFLAKE_KAFKA_CONNECTOR_SINKSNOWFLAKE_STAGE_DBDEMO’ does not exist or not authorized.\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:152)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:77)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:495)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:372)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:575)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:265)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:203)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.execute(SFStatement.java:874)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeStatementV1.executeInternal(SnowflakeStatementV1.java:309)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakePreparedStatementV1.execute(SnowflakePreparedStatementV1.java:516)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:145)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.FutureTask.run(FutureTask.java:266)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n[SF_KAFKA_CONNECTOR] java.lang.Thread.run(Thread.java:748)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:397)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:373)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:360)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:149)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n\tat com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n\t… 10 more\n”},{“id”:2,”state”:”FAILED”,”worker_id”:”127.0.0.1:8083″,”trace”:”org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception.\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:567)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n\tat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n\tat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: com.snowflake.kafka.connector.internal.SnowflakeKafkaConnectorException: \n[SF_KAFKA_CONNECTOR] Exception: Failed to create stage\n[SF_KAFKA_CONNECTOR] Error Code: 2008\n[SF_KAFKA_CONNECTOR] Detail: Failed to create stage on Snowflake, please check that you have permission to do so.\n[SF_KAFKA_CONNECTOR] Message: SQL compilation error:\n[SF_KAFKA_CONNECTOR] Database ‘SNOWFLAKE_KAFKA_CONNECTOR_SINKSNOWFLAKE_STAGE_DBDEMO’ does not exist or not authorized.\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:152)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:77)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:495)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:372)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:575)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:265)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:203)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.execute(SFStatement.java:874)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeStatementV1.executeInternal(SnowflakeStatementV1.java:309)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakePreparedStatementV1.execute(SnowflakePreparedStatementV1.java:516)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:145)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.FutureTask.run(FutureTask.java:266)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n[SF_KAFKA_CONNECTOR] java.lang.Thread.run(Thread.java:748)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:397)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:373)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:360)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:149)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n\tat com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n\t… 10 more\n”},{“id”:3,”state”:”FAILED”,”worker_id”:”127.0.0.1:8083″,”trace”:”org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception.\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:567)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n\tat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n\tat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: com.snowflake.kafka.connector.internal.SnowflakeKafkaConnectorException: \n[SF_KAFKA_CONNECTOR] Exception: Failed to create stage\n[SF_KAFKA_CONNECTOR] Error Code: 2008\n[SF_KAFKA_CONNECTOR] Detail: Failed to create stage on Snowflake, please check that you have permission to do so.\n[SF_KAFKA_CONNECTOR] Message: SQL compilation error:\n[SF_KAFKA_CONNECTOR] Database ‘SNOWFLAKE_KAFKA_CONNECTOR_SINKSNOWFLAKE_STAGE_DBDEMO’ does not exist or not authorized.\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:152)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:77)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:495)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:372)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:575)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:265)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:203)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.execute(SFStatement.java:874)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeStatementV1.executeInternal(SnowflakeStatementV1.java:309)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakePreparedStatementV1.execute(SnowflakePreparedStatementV1.java:516)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:145)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.FutureTask.run(FutureTask.java:266)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n[SF_KAFKA_CONNECTOR] java.lang.Thread.run(Thread.java:748)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:397)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:373)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:360)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:149)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n\tat com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n\t… 10 more\n”},{“id”:4,”state”:”FAILED”,”worker_id”:”127.0.0.1:8083″,”trace”:”org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception.\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:567)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n\tat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n\tat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: com.snowflake.kafka.connector.internal.SnowflakeKafkaConnectorException: \n[SF_KAFKA_CONNECTOR] Exception: Failed to create stage\n[SF_KAFKA_CONNECTOR] Error Code: 2008\n[SF_KAFKA_CONNECTOR] Detail: Failed to create stage on Snowflake, please check that you have permission to do so.\n[SF_KAFKA_CONNECTOR] Message: SQL compilation error:\n[SF_KAFKA_CONNECTOR] Database ‘SNOWFLAKE_KAFKA_CONNECTOR_SINKSNOWFLAKE_STAGE_DBDEMO’ does not exist or not authorized.\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:152)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:77)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:495)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:372)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:575)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:265)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:203)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.execute(SFStatement.java:874)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeStatementV1.executeInternal(SnowflakeStatementV1.java:309)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakePreparedStatementV1.execute(SnowflakePreparedStatementV1.java:516)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:145)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.FutureTask.run(FutureTask.java:266)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n[SF_KAFKA_CONNECTOR] java.lang.Thread.run(Thread.java:748)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:397)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:373)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:360)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:149)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n\tat com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n\t… 10 more\n”},{“id”:5,”state”:”FAILED”,”worker_id”:”127.0.0.1:8083″,”trace”:”org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception.\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:567)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n\tat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n\tat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: com.snowflake.kafka.connector.internal.SnowflakeKafkaConnectorException: \n[SF_KAFKA_CONNECTOR] Exception: Failed to create stage\n[SF_KAFKA_CONNECTOR] Error Code: 2008\n[SF_KAFKA_CONNECTOR] Detail: Failed to create stage on Snowflake, please check that you have permission to do so.\n[SF_KAFKA_CONNECTOR] Message: SQL compilation error:\n[SF_KAFKA_CONNECTOR] Database ‘SNOWFLAKE_KAFKA_CONNECTOR_SINKSNOWFLAKE_STAGE_DBDEMO’ does not exist or not authorized.\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:152)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:77)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:495)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:372)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:575)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:265)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:203)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.execute(SFStatement.java:874)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeStatementV1.executeInternal(SnowflakeStatementV1.java:309)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakePreparedStatementV1.execute(SnowflakePreparedStatementV1.java:516)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:145)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.FutureTask.run(FutureTask.java:266)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n[SF_KAFKA_CONNECTOR] java.lang.Thread.run(Thread.java:748)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:397)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:373)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:360)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:149)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n\tat com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n\t… 10 more\n”},{“id”:6,”state”:”FAILED”,”worker_id”:”127.0.0.1:8083″,”trace”:”org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception.\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:567)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n\tat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n\tat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: com.snowflake.kafka.connector.internal.SnowflakeKafkaConnectorException: \n[SF_KAFKA_CONNECTOR] Exception: Failed to create stage\n[SF_KAFKA_CONNECTOR] Error Code: 2008\n[SF_KAFKA_CONNECTOR] Detail: Failed to create stage on Snowflake, please check that you have permission to do so.\n[SF_KAFKA_CONNECTOR] Message: SQL compilation error:\n[SF_KAFKA_CONNECTOR] Database ‘SNOWFLAKE_KAFKA_CONNECTOR_SINKSNOWFLAKE_STAGE_DBDEMO’ does not exist or not authorized.\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:152)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:77)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:495)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:372)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:575)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:265)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:203)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.execute(SFStatement.java:874)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeStatementV1.executeInternal(SnowflakeStatementV1.java:309)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakePreparedStatementV1.execute(SnowflakePreparedStatementV1.java:516)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:145)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.FutureTask.run(FutureTask.java:266)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n[SF_KAFKA_CONNECTOR] java.lang.Thread.run(Thread.java:748)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:397)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:373)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:360)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:149)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n\tat com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n\t… 10 more\n”},{“id”:7,”state”:”FAILED”,”worker_id”:”127.0.0.1:8083″,”trace”:”org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception.\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:567)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n\tat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n\tat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: com.snowflake.kafka.connector.internal.SnowflakeKafkaConnectorException: \n[SF_KAFKA_CONNECTOR] Exception: Failed to create stage\n[SF_KAFKA_CONNECTOR] Error Code: 2008\n[SF_KAFKA_CONNECTOR] Detail: Failed to create stage on Snowflake, please check that you have permission to do so.\n[SF_KAFKA_CONNECTOR] Message: SQL compilation error:\n[SF_KAFKA_CONNECTOR] Database ‘SNOWFLAKE_KAFKA_CONNECTOR_SINKSNOWFLAKE_STAGE_DBDEMO’ does not exist or not authorized.\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:152)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:77)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:495)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:372)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:575)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:265)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:203)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.core.SFStatement.execute(SFStatement.java:874)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakeStatementV1.executeInternal(SnowflakeStatementV1.java:309)\n[SF_KAFKA_CONNECTOR] net.snowflake.client.jdbc.SnowflakePreparedStatementV1.execute(SnowflakePreparedStatementV1.java:516)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:145)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n[SF_KAFKA_CONNECTOR] com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:325)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:228)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:200)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n[SF_KAFKA_CONNECTOR] org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.FutureTask.run(FutureTask.java:266)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n[SF_KAFKA_CONNECTOR] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n[SF_KAFKA_CONNECTOR] java.lang.Thread.run(Thread.java:748)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:397)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:373)\n\tat com.snowflake.kafka.connector.internal.SnowflakeErrors.getException(SnowflakeErrors.java:360)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:149)\n\tat com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceV1.createStage(SnowflakeConnectionServiceV1.java:158)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.createTableAndStage(SnowflakeSinkServiceV1.java:819)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.init(SnowflakeSinkServiceV1.java:338)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.insert(SnowflakeSinkServiceV1.java:435)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1$ServiceContext.access$300(SnowflakeSinkServiceV1.java:271)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:107)\n\tat com.snowflake.kafka.connector.internal.SnowflakeSinkServiceV1.insert(SnowflakeSinkServiceV1.java:84)\n\tat com.snowflake.kafka.connector.SnowflakeSinkTask.put(SnowflakeSinkTask.java:218)\n\tat org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:545)\n\t… 10 more\n”}],”type”:”sink”}

Generate public and private key for snowflake kafka connection

install the snowflake connector
#page source
# https://www.confluent.io/hub/snowflakeinc/snowflake-kafka-connector

confluent-hub install snowflakeinc/snowflake-kafka-connector:1.4.3

#restart the kafka after installation

##
https://docs.snowflake.com/en/user-guide/kafka-connector-install.html#required-privileges

create the public and private key
#instruction page

#For example, to specify AES 256 as the encryption algorithm:
>>>>>>>>>>>>>>>>>
openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 aes256 -inform PEM -out rsa_key.p8

From the command line, generate the public key by referencing the private key:
Assuming the private key is encrypted and contained in the file named rsa_key.p8, use the following command:

>>>>>>>>>>>>>>>>>
$ openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub

Sample PEM public key
—–BEGIN PUBLIC KEY—–
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy+Fw2qv4Roud3l6tjPH4
zxybHjmZ5rhtCz9jppCV8UTWvEXxa88IGRIHbJ/PwKW/mR8LXdfI7l/9vCMXX4mk

—–END PUBLIC KEY—–

Snowflake create connection roles

USE ROLE securityadmin;

— Create a Snowflake role with the privileges to work with the connector
CREATE ROLE kafka_conn_role;

— Grant privileges on the database:
GRANT USAGE ON DATABASE DBDEMO TO ROLE kafka_conn_role;

— Grant privileges on the schema:
GRANT USAGE ON SCHEMA SEC TO ROLE kafka_conn_role;
GRANT CREATE TABLE ON SCHEMA SEC TO ROLE kafka_conn_role;
GRANT CREATE STAGE ON SCHEMA SEC TO ROLE kafka_conn_role;
GRANT CREATE PIPE ON SCHEMA SEC TO ROLE kafka_conn_role;

— Only required if the Kafka connector will load data into an existing table:
GRANT SELECT, INSERT ON TABLE SHORTTEST TO ROLE kafka_conn_role;

— Only required if the Kafka connector will stage data files in an existing internal stage: (not recommended):
–GRANT READ, WRITE ON STAGE existing_stage1 TO ROLE kafka_conn_role;

— Grant the custom role to an existing user:
GRANT ROLE kafka_conn_role TO USER kafka_connector_user_1;

(

Snowflake create users and roles

CREATE TABLE SEC.CUSTOMERS(
id int NOT NULL,
first_name varchar(255) NOT NULL,
last_name varchar(255) NOT NULL,
email varchar(255) NOT NULL,
PRIMARY KEY CLUSTERED
(
id ASC
);

create user kafkaconn identified by ‘kafkaConn#1’;

— Create a Snowflake role with the privileges to work with the connector
CREATE ROLE KConnRole;

— Grant privileges on the database:
GRANT USAGE ON DATABASE DBDEMO TO ROLE KConnRole;

— Grant privileges on the schema:
GRANT USAGE ON SCHEMA SEC TO ROLE KConnRole;
GRANT CREATE TABLE ON SCHEMA SEC TO ROLE KConnRole;
GRANT CREATE STAGE ON SCHEMA SEC TO ROLE KConnRole;
GRANT CREATE PIPE ON SCHEMA SEC TO ROLE KConnRole;

— Only required if the Kafka connector will load data into an existing table:
GRANT SELECT, INSERT ON TABLE existing_table1 TO ROLE KConnRole;

— Only required if the Kafka connector will stage data files in an existing internal stage: (not recommended):
GRANT READ, WRITE ON STAGE existing_stage1 TO ROLE KConnRole;

— Grant the custom role to an existing user:
GRANT ROLE KConnRole TO USER kafkaconn;

Snowflake kafka Connect Example

{
“name”:”sinkSnowFlake”,
“config”:{
“connector.class”:”com.snowflake.kafka.connector.SnowflakeSinkConnector”,
“tasks.max”:”8″,
“topics”:”TestDB1.dbo.customers”,
“snowflake.topic2table.map”: “TestDB1.dbo.customers:customers”,
“buffer.count.records”:”100″,
“buffer.flush.time”:”60″,
“buffer.size.bytes”:”5000″,
“snowflake.url.name”:”pr12345.us-east-2.aws.snowflakecomputing.com”,
“snowflake.user.name”:”kafkaconn”,
“snowflake.private.key”:”MIIFHzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQI0NwW0LsJo9MCAggA
MB0GCWCGSAFlAwQBKgQQ96QtFwudckyC3vYabEjaPQSCBNBwpGnuMr5HvwjOue7N
uYrbp/Nx9KY0sNTiyFbnCnPhV7WDXC6Lto2hOinYIvhnOUrLhp3/wmfx8Sst38Tt
pNXmCbwZihr/10FoTTdCLfsAYYsel1QiO/7Yup3OqVXBAOzoRHqmdCrvtGV+jrhg
2cLvwfOzv0IWwNkG1MuspufsuT/TGl+dTq1oGty/c80xr3cZep/42Rjg5gV/CPeH
R1tzXUXfIVpWbP913uM1UwJwOkkeO1AVEMM7ww8MFdWfx5kkb1TE3vpjklCwGWgq
M0B8wBSjaWgM73bIBwTqXvt3ql6QIvEbEYGdTfgeHW+s3pRJVfjn7ejK3g2IfgHv
YxRlrvhBE+/hO0cU9/nblZgA97qmVuQB9wSQ4zh5cgjYb0WnknG5zb1FnJ3NJjA2
c2zK/ArCkSkC2yY4Ooqo3tpSrTBp0Zra2WwyeLtAXnH8D86FvHWSccJf2xQiuZZH
6bVIfJgkIoAQ3ys9bPsz1RqrPjlHVQ69TpmRACC8+Ja6qxOcw+7jwyIZG+lT2+Rf
/0qtCLv92TMSOj2978htAAZSTz72rw9FjVzhMzavOE+Qem2jFvJHf6bTwoeiqbBJ
vA/tgx5BOMURLtan9S+RRCVlOyg35za/aleE11zn4tvzWEq5PhnOPytsiKFa19Lm
cJndI/1ZqlACy6KAmHtga6p07mz/3i+lizb/5ftcHWmtir8+Tz+IRNsu1tlnQBEu
kTguHwXNnPjs/nES/xS+dtohHvcpiyLiUC9Bs2Mlgo2OFVz4U62PyWXlRdhgk6N6
0DIhy1eD0ku4nLaOVMWfJD73JuYcO3xvK3nxaOfyzLvPT5xuCraAfVODBXBRouOO
upAPWHLNqH9cgFqvTi7p+rm+2XBURlTja2pc5fSUFB6OCiwr5lRKWQtUGSMQiMkp
dTV1iyInw+kzEUhDuIhOYHWX7PlFQLav0fVRqQ0Am2j/Ec2GnTqQZJHgfIpgk5kX
iu5jJ9WndkQFezHO9fTShJq2SJdXy5aZbSBD/N3L3mWqUrHSwPoGMi5soT9gtps1
r3ZBHx+KaL5BrlAFSGYaPEZ99G5tu0Yc/Rz5/UYVvcDDAz9Rbc7zctQ5xadYx47p
d8JMKMjK7hLEtUf/p7eMT+jk/gy4uCSVnxhrSSxkkVuuOP6dQ5ZThzatnVmzvxh6
gsVsoxqNdamo1ps3+AFt6//2nuBHKSOntJpxeTknHAjcpPeXZX0vlcKlp1fqgMnu
44aWtwJDwKhWfpdqP0yyCIXgyYWNEU7YCs3l4ZMBvL4gD6vmq9+rGfdOXROvRwzQ
SvJIBs5nj+tI3Rc886+UZqCFlJWgwgLZySqs7ptO0gim8PRrkdvejqdpafjPH01i
yZcUvS6LddeF6iotooAYQo41+CB9srskjwmPdym5ixQWtAhmnlp0lMVjBCKr03fB
MPyyDTRfPrWVOPIjsplh6mawNHTRQ9g0ogP27Rabkwr4b2/5s150FRYXdnvjiPkH
QafYoORTglhCqJ5jkbO9rs1bLlz4rem7I4DWElzFhtLR+fsi1xvBHeNoHdx1hIVL
AK+CFkKtti5XcpYZcjh9BNuB/TerLcpOxbwbrrYUR0iulsOI3tx791+CreC0N48c
wWOk1HJD1nY7W1VRRdi3IYy4eA==”,
“snowflake.private.key.passphrase”:”Passme09″,
“snowflake.database.name”:”DBDEMO”,
“snowflake.schema.name”:”SEC”,
“key.converter”:”org.apache.kafka.connect.storage.StringConverter”,
“value.converter”:”com.snowflake.kafka.connector.records.SnowflakeAvroConverter”,
“value.converter.schema.registry.url”:”http://localhost:8081″,
“value.converter.basic.auth.credentials.source”:”USER_INFO”,
“value.converter.basic.auth.user.info”:”kafkaconn:kafkaConn#1″
}
}

{“name”:”sinkSnowFlake”,
“config”:{“connector.class”:”com.snowflake.kafka.connector.SnowflakeSinkConnector”
,”tasks.max”:”8″ ,”topics”:”TestDB1.dbo.customers”,”snowflake.topic2table.map”:”TestDB1.dbo.customers:DBDEMO.SEC.customers”,”buffer.count.r ecords”:”10000″,”buffer.flush.time”:”60″,”buffer.size.bytes”:”5000000″,”snowflake.url.name”:”pr56725.us-east-2.aws.snowfla kecomputing.com”,”snowflake.user.name”:”kafkaconn”,”snowflake.private.key”:”MIIFHzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDg QI0NwW0LsJo9MCAggAMB0GCWCGSAFlAwQBKgQQ96QtFwudckyC3vYabEjaPQSCBNBwpGnuMr5HvwjOue7NuYrbp/Nx9KY0sNTiyFbnCnPhV7WDXC6Lto2hOinY IvhnOUrLhp3/wmfx8Sst38TtpNXmCbwZihr/10FoTTdCLfsAYYsel1QiO/7Yup3OqVXBAOzoRHqmdCrvtGV+jrhg2cLvwfOzv0IWwNkG1MuspufsuT/TGl+dTq 1oGty/c80xr3cZep/42Rjg5gV/CPeHR1tzXUXfIVpWbP913uM1UwJwOkkeO1AVEMM7ww8MFdWfx5kkb1TE3vpjklCwGWgqM0B8wBSjaWgM73bIBwTqXvt3ql6Q IvEbEYGdTfgeHW+s3pRJVfjn7ejK3g2IfgHvYxRlrvhBE+/hO0cU9/nblZgA97qmVuQB9wSQ4zh5cgjYb0WnknG5zb1FnJ3NJjA2c2zK/ArCkSkC2yY4Ooqo3t pSrTBp0Zra2WwyeLtAXnH8D86FvHWSccJf2xQiuZZH6bVIfJgkIoAQ3ys9bPsz1RqrPjlHVQ69TpmRACC8+Ja6qxOcw+7jwyIZG+lT2+Rf/0qtCLv92TMSOj29 78htAAZSTz72rw9FjVzhMzavOE+Qem2jFvJHf6bTwoeiqbBJvA/tgx5BOMURLtan9S+RRCVlOyg35za/aleE11zn4tvzWEq5PhnOPytsiKFa19LmcJndI/1Zql ACy6KAmHtga6p07mz/3i+lizb/5ftcHWmtir8+Tz+IRNsu1tlnQBEukTguHwXNnPjs/nES/xS+dtohHvcpiyLiUC9Bs2Mlgo2OFVz4U62PyWXlRdhgk6N60DIh y1eD0ku4nLaOVMWfJD73JuYcO3xvK3nxaOfyzLvPT5xuCraAfVODBXBRouOOupAPWHLNqH9cgFqvTi7p+rm+2XBURlTja2pc5fSUFB6OCiwr5lRKWQtUGSMQiM kpdTV1iyInw+kzEUhDuIhOYHWX7PlFQLav0fVRqQ0Am2j/Ec2GnTqQZJHgfIpgk5kXiu5jJ9WndkQFezHO9fTShJq2SJdXy5aZbSBD/N3L3mWqUrHSwPoGMi5s oT9gtps1r3ZBHx+KaL5BrlAFSGYaPEZ99G5tu0Yc/Rz5/UYVvcDDAz9Rbc7zctQ5xadYx47pd8JMKMjK7hLEtUf/p7eMT+jk/gy4uCSVnxhrSSxkkVuuOP6dQ5 ZThzatnVmzvxh6gsVsoxqNdamo1ps3+AFt6//2nuBHKSOntJpxeTknHAjcpPeXZX0vlcKlp1fqgMnu44aWtwJDwKhWfpdqP0yyCIXgyYWNEU7YCs3l4ZMBvL4g D6vmq9+rGfdOXROvRwzQSvJIBs5nj+tI3Rc886+UZqCFlJWgwgLZySqs7ptO0gim8PRrkdvejqdpafjPH01iyZcUvS6LddeF6iotooAYQo41+CB9srskjwmPdy m5ixQWtAhmnlp0lMVjBCKr03fBMPyyDTRfPrWVOPIjsplh6mawNHTRQ9g0ogP27Rabkwr4b2/5s150FRYXdnvjiPkHQafYoORTglhCqJ5jkbO9rs1bLlz4rem7 I4DWElzFhtLR+fsi1xvBHeNoHdx1hIVLAK+CFkKtti5XcpYZcjh9BNuB/TerLcpOxbwbrrYUR0iulsOI3tx791+CreC0N48cwWOk1HJD1nY7W1VRRdi3IYy4eA ==”,”snowflake.private.key.passphrase”:”Passme09″,”snowflake.database.name”:”DBDEMO”,”snowflake.schema.name”:”SEC”,”key.co nverter”:”org.apache.kafka.connect.storage.StringConverter”,”value.converter”:”com.snowflake.kafka.connector.records.Snowf lakeAvroConverter”,”value.converter.schema.registry.url”:”http://localhost:8081″,”value.converter.basic.auth.credentials.s ource”:”USER_INFO”,”value.converter.basic.auth.user.info”:”kafkaconn:kafkaConn#1″,”name”:”sinkSnowFlake”}
}