Re: How can I write data to hive with jdbc

2021-08-04 Thread Mich Talebzadeh
Actually if read from that table you can just do val tableName = "joinwarehouse.ods_job_log" option("dbtable", tableName) Also I made a typo in the url. val url = "jdbc:hive2://tidb4ser:11000/default" Just put default there for the database name. HTH view my Linkedin profile

Re: How can I write data to hive with jdbc

2021-08-04 Thread Mich Talebzadeh
Caused by: org.apache.spark.sql.catalyst.analysis.NoSuchTableException: Table or view 'ods_job_log' not found in database 'default'; Where is your table? It is looking at *default database* In general this is the format read_df = spark.read. \ format("jdbc"). \

Re: How can I write data to hive with jdbc

2021-07-30 Thread Mich Talebzadeh
This is a generic JDBC write to a DB from Pyspark def writeTableWithJDBC(dataFrame, url, tableName, user, password, driver, mode): try: dataFrame. \ write. \ format("jdbc"). \ option("url", url). \ option("dbtable", tableName). \