dik111 opened a new issue #1438:
URL: https://github.com/apache/incubator-seatunnel/issues/1438


   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   I am new to apache seatunnel, I test seatunnel mysql to hive, but is throw  
an exection Exception: 
`org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException: Database 
'test' not found`
   and i add enableHiveSupport() in 
   `this.sparkSession = SparkSession.builder().config(sparkConf).getOrCreate();`
   It solves the problem.
   Is there any configuration I miss?
   
   ### SeaTunnel Version
   
   dev (2022-03-08)
   
   ### SeaTunnel Config
   
   ```conf
   env {
     # seatunnel defined streaming batch duration in seconds
     spark.streaming.batchDuration = 5
   
     spark.app.name = "seatunnel"
     spark.ui.port = 13000
   }
   
   source {
     jdbc {
       driver = "com.mysql.jdbc.Driver"
       url = "jdbc:mysql://xx:3306/test?useSSL=false"
       table = "user_info"
       result_table_name = "user_info"
       user = "xx"
       password = "xx"
   }
   }
   
   transform {
   
   }
   
   sink {
     Hive {
       source_table_name = "user_info"
       result_table_name = "test.user_info1"
       save_mode = "overwrite"
       sink_columns = "id,name"
     }
   }
   ```
   
   
   ### Running Command
   
   ```shell
   bin/start-seatunnel-spark.sh --master local[4] --deploy-mode client --config 
./config/mysql-hive-example.conf
   ```
   
   
   ### Error Exception
   
   ```log
   Exception in thread "main" 
org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException: Database 'test' 
not found;
           at 
org.apache.spark.sql.catalyst.catalog.ExternalCatalog$class.requireDbExists(ExternalCatalog.scala:42)
           at 
org.apache.spark.sql.catalyst.catalog.InMemoryCatalog.requireDbExists(InMemoryCatalog.scala:45)
           at 
org.apache.spark.sql.catalyst.catalog.InMemoryCatalog.tableExists(InMemoryCatalog.scala:331)
           at 
org.apache.spark.sql.catalyst.catalog.ExternalCatalogWithListener.tableExists(ExternalCatalogWithListener.scala:142)
           at 
org.apache.spark.sql.catalyst.catalog.SessionCatalog.tableExists(SessionCatalog.scala:420)
           at 
org.apache.spark.sql.DataFrameWriter.saveAsTable(DataFrameWriter.scala:414)
           at 
org.apache.spark.sql.DataFrameWriter.saveAsTable(DataFrameWriter.scala:409)
           at org.apache.seatunnel.spark.sink.Hive.output(Hive.scala:64)
           at org.apache.seatunnel.spark.sink.Hive.output(Hive.scala:29)
           at 
org.apache.seatunnel.spark.batch.SparkBatchExecution.sinkProcess(SparkBatchExecution.java:90)
           at 
org.apache.seatunnel.spark.batch.SparkBatchExecution.start(SparkBatchExecution.java:105)
           at org.apache.seatunnel.Seatunnel.entryPoint(Seatunnel.java:107)
           at org.apache.seatunnel.Seatunnel.run(Seatunnel.java:65)
           at org.apache.seatunnel.SeatunnelSpark.main(SeatunnelSpark.java:29)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at 
org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
           at 
org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:845)
           at 
org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:161)
           at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:184)
           at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:86)
           at 
org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:920)
           at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:929)
           at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
   ```
   
   
   ### Flink or Spark Version
   
   spark version  2.4.4
   
   ### Java or Scala Version
   
   java version 1.8
   mysql version 5.7
   hive version 3.0.0
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to